← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 1818: 1. Fix Bruno's compile error pkg/dem/meta/Shop.cpp:281: error: operands to ?: have different types

 

------------------------------------------------------------
revno: 1818
committer: Václav Šmilauer <eudoxos@xxxxxxxx>
branch nick: trunk
timestamp: Fri 2009-11-27 12:33:19 +0100
message:
  1. Fix Bruno's compile error pkg/dem/meta/Shop.cpp:281: error: operands to ?: have different types 
  'boost::shared_ptr<Material>' and 'boost::shared_ptr<GranularMat>'
  2. Fix warning's from out-of-order initializer in State.
modified:
  core/State.hpp
  pkg/dem/meta/Shop.cpp


--
lp:yade
https://code.launchpad.net/~yade-dev/yade/trunk

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-dev/yade/trunk/+edit-subscription.
=== modified file 'core/State.hpp'
--- core/State.hpp	2009-11-26 10:34:14 +0000
+++ core/State.hpp	2009-11-27 11:33:19 +0000
@@ -60,7 +60,7 @@
 		//! Setter of blockedDOFs from list of strings (['x','rx','rz'] → DOF_X | DOR_RX | DOF_RZ)
 		void blockedDOFs_vec_set(const std::vector<std::string>& dofs);
 
-	State(): se3(Vector3r::ZERO,Quaternionr::IDENTITY),pos(se3.position),vel(Vector3r::ZERO),accel(Vector3r::ZERO),mass(0.),ori(se3.orientation),angVel(Vector3r::ZERO),angAccel(Vector3r::ZERO),inertia(Vector3r::ZERO),refPos(Vector3r::ZERO),refOri(Quaternionr::IDENTITY),blockedDOFs(DOF_NONE),prevAngMom(Vector3r::ZERO){}
+	State(): se3(Vector3r::ZERO,Quaternionr::IDENTITY),pos(se3.position),vel(Vector3r::ZERO),accel(Vector3r::ZERO),mass(0.),ori(se3.orientation),angVel(Vector3r::ZERO),angAccel(Vector3r::ZERO),inertia(Vector3r::ZERO),prevAngMom(Vector3r::ZERO),refPos(Vector3r::ZERO),refOri(Quaternionr::IDENTITY),blockedDOFs(DOF_NONE){}
 
 	REGISTER_CLASS_AND_BASE(State,Serializable);
 	REGISTER_ATTRIBUTES(Serializable,(pos)(vel)(accel)(mass)(ori)(angVel)(angAccel)(inertia)(refPos)(refOri)(blockedDOFs)(prevAngMom));

=== modified file 'pkg/dem/meta/Shop.cpp'
--- pkg/dem/meta/Shop.cpp	2009-11-25 21:21:17 +0000
+++ pkg/dem/meta/Shop.cpp	2009-11-27 11:33:19 +0000
@@ -278,7 +278,7 @@
 shared_ptr<Body> Shop::sphere(Vector3r center, Real radius, shared_ptr<Material> mat){
 	shared_ptr<Body> body(new Body);
 	body->isDynamic=true;
-	body->material=mat ? mat : defaultGranularMat();
+	body->material=mat ? mat : static_pointer_cast<Material>(defaultGranularMat());
 	body->state->pos=center;
 	body->state->mass=4.0/3.0*Mathr::PI*radius*radius*radius*body->material->density;
 	body->state->inertia=Vector3r(2.0/5.0*body->state->mass*radius*radius,2.0/5.0*body->state->mass*radius*radius,2.0/5.0*body->state->mass*radius*radius);
@@ -291,7 +291,7 @@
 shared_ptr<Body> Shop::box(Vector3r center, Vector3r extents, shared_ptr<Material> mat){
 	shared_ptr<Body> body(new Body);
 	body->isDynamic=true;
-	body->material=mat ? mat : defaultGranularMat();
+	body->material=mat ? mat : static_pointer_cast<Material>(defaultGranularMat());
 	body->state->pos=center;
 	Real mass=8.0*extents[0]*extents[1]*extents[2]*body->material->density;
 	body->state->mass=mass;
@@ -305,7 +305,7 @@
 shared_ptr<Body> Shop::tetra(Vector3r v_global[4], shared_ptr<Material> mat){
 	shared_ptr<Body> body(new Body);
 	body->isDynamic=true;
-	body->material=mat ? mat : defaultGranularMat();
+	body->material=mat ? mat : static_pointer_cast<Material>(defaultGranularMat());
 	Vector3r centroid=(v_global[0]+v_global[1]+v_global[2]+v_global[3])*.25;
 	Vector3r v[4]; for(int i=0; i<4; i++) v[i]=v_global[i]-centroid;
 	body->state->pos=centroid;