← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 2607: 1. Remove Body::flags/FLAG_DYNAMIC, setDynamic now merely sets state->blockedDOFs=State::DOF_ALL ...

 

------------------------------------------------------------
revno: 2607
committer: Václav Šmilauer <eu@xxxxxxxx>
branch nick: yade
timestamp: Fri 2010-12-10 16:07:56 +0100
message:
  1. Remove Body::flags/FLAG_DYNAMIC, setDynamic now merely sets state->blockedDOFs=State::DOF_ALL etc.
  2. Remove some deprecated code chunks
modified:
  core/Body.hpp
  pkg/common/InteractionLoop.hpp
  pkg/common/OpenGLRenderer.hpp
  pkg/common/StepDisplacer.cpp
  pkg/common/StepDisplacer.hpp


--
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/Body.hpp'
--- core/Body.hpp	2010-12-05 17:10:06 +0000
+++ core/Body.hpp	2010-12-10 15:07:56 +0000
@@ -31,7 +31,7 @@
 		typedef std::map<Body::id_t, shared_ptr<Interaction> > MapId2IntrT;
 
 		// bits for Body::flags
-		enum { FLAG_DYNAMIC=1, FLAG_BOUNDED=2, FLAG_ASPHERICAL=4 }; /* add powers of 2 as needed */
+		enum { FLAG_BOUNDED=1, FLAG_ASPHERICAL=2 }; /* add powers of 2 as needed */
 		//! symbolic constant for body that doesn't exist.
 		static const Body::id_t ID_NONE;
 		//! get Body pointer given its id. 
@@ -50,8 +50,8 @@
 		//! Whether this body has all DOFs blocked
 		// inline accessors
 		// logic: http://stackoverflow.com/questions/47981/how-do-you-set-clear-and-toggle-a-single-bit-in-c
-		bool isDynamic() const {return flags & FLAG_DYNAMIC; }
-		void setDynamic(bool d){ if(d){ flags|=FLAG_DYNAMIC; if(state) state->blockedDOFs=State::DOF_NONE; } else { flags&=~(FLAG_DYNAMIC); if(state){ state->blockedDOFs=State::DOF_ALL; state->vel=state->angVel=Vector3r::Zero(); } }}
+		bool isDynamic() const { assert(state); return state->blockedDOFs!=State::DOF_ALL; }
+		void setDynamic(bool d){ assert(state); if(d){ state->blockedDOFs=State::DOF_NONE; } else { state->blockedDOFs=State::DOF_ALL; state->vel=state->angVel=Vector3r::Zero(); } }
 		bool isBounded() const {return flags & FLAG_BOUNDED; }
 		void setBounded(bool d){ if(d) flags|=FLAG_BOUNDED; else flags&=~(FLAG_BOUNDED); }
 		bool isAspherical() const {return flags & FLAG_ASPHERICAL; }
@@ -74,7 +74,7 @@
 		((Body::id_t,id,Body::ID_NONE,Attr::readonly,"Unique id of this body."))
 
 		((int,groupMask,1,,"Bitmask for determining interactions."))
-		((int,flags,FLAG_DYNAMIC|FLAG_BOUNDED,Attr::readonly,"Bits of various body-related flags. *Do not access directly*. In c++, use isDynamic/setDynamic, isBounded/setBounded, isAspherical/setAspherical. In python, use :yref:`Body.dynamic`, :yref:`Body.bounded`, :yref:`Body.aspherical`."))
+		((int,flags,FLAG_BOUNDED,Attr::readonly,"Bits of various body-related flags. *Do not access directly*. In c++, use isDynamic/setDynamic, isBounded/setBounded, isAspherical/setAspherical. In python, use :yref:`Body.dynamic`, :yref:`Body.bounded`, :yref:`Body.aspherical`."))
 		#ifdef YADE_SUBDOMAINS
 			((Body::id_t,subDomId,Body::ID_NONE,(Attr::noSave|Attr::readonly),"Subdomain number and position within the subdomain encoded in one single number; holds back-reference to BodyContainer::subDomains location, so that erasing a body knows where to go. See BodyContainer for details."))
 		#endif
@@ -89,7 +89,6 @@
 		/* py */
 		//
 		.def_readwrite("mat",&Body::material,"Shorthand for :yref:`Body::material`")
-		.add_property("isDynamic",&Body::isDynamic,&Body::setDynamic,"Deprecated synonym for :yref:`Body::dynamic` |ydeprecated|")
 		.add_property("dynamic",&Body::isDynamic,&Body::setDynamic,"Whether this body will be moved by forces. (In c++, use ``Body::isDynamic``/``Body::setDynamic``) :ydefault:`true`")
 		.add_property("bounded",&Body::isBounded,&Body::setBounded,"Whether this body should have :yref:`Body.bound` created. Note that bodies without a :yref:`bound <Body.bound>` do not participate in collision detection. (In c++, use ``Body::isBounded``/``Body::setBounded``) :ydefault:`true`")
 		.add_property("aspherical",&Body::isAspherical,&Body::setAspherical,"Whether this body has different inertia along principal axes; :yref:`NewtonIntegrator` makes use of this flag to call rotation integration routine for aspherical bodies, which is more expensive. :ydefault:`false`")

=== modified file 'pkg/common/InteractionLoop.hpp'
--- pkg/common/InteractionLoop.hpp	2010-11-07 11:46:20 +0000
+++ pkg/common/InteractionLoop.hpp	2010-12-10 15:07:56 +0000
@@ -37,7 +37,3 @@
 		DECLARE_LOGGER;
 };
 REGISTER_SERIALIZABLE(InteractionLoop);
-
-// old name, issue warning when used in external code
-__attribute__((deprecated)) typedef InteractionLoop InteractionDispatchers;
-

=== modified file 'pkg/common/OpenGLRenderer.hpp'
--- pkg/common/OpenGLRenderer.hpp	2010-11-30 13:51:41 +0000
+++ pkg/common/OpenGLRenderer.hpp	2010-12-10 15:07:56 +0000
@@ -21,8 +21,6 @@
 class OpenGLRenderer : public Serializable
 {
 	public:
-		int _nothing; // remove later, only target for deprecated selectBodyLimit
-
 		static const int numClipPlanes=3;
 
 		bool pointClipped(const Vector3r& p);

=== modified file 'pkg/common/StepDisplacer.cpp'
--- pkg/common/StepDisplacer.cpp	2010-10-13 16:23:08 +0000
+++ pkg/common/StepDisplacer.cpp	2010-12-10 15:07:56 +0000
@@ -6,12 +6,6 @@
 YADE_PLUGIN((StepDisplacer));
 
 void StepDisplacer::action(){
-	if(!isnan(deltaSe3.position[0])){
-		LOG_WARN("Using StepDisplacer::deltaSe3 is deprecated, use StepDisplacer.mov and StepDisplacer.rot instead (setting automatically now).");
-		mov=deltaSe3.position;
-		rot=deltaSe3.orientation;
-		deltaSe3.position=Vector3r(NaN,NaN,NaN); // to detect next manual change of deltaSe3
-	}
 	FOREACH(Body::id_t id, ids){
 		const shared_ptr<Body>& b=Body::byId(id,scene);
 		if(setVelocities){

=== modified file 'pkg/common/StepDisplacer.hpp'
--- pkg/common/StepDisplacer.hpp	2010-11-03 15:50:02 +0000
+++ pkg/common/StepDisplacer.hpp	2010-12-10 15:07:56 +0000
@@ -7,7 +7,6 @@
 	public:
 		virtual void action();
 	YADE_CLASS_BASE_DOC_ATTRS(StepDisplacer,PartialEngine,"Apply generalized displacement (displacement or rotation) stepwise on subscribed bodies.",
-		((Se3r,deltaSe3,Se3r(Vector3r(NaN,NaN,NaN),Quaternionr::Identity()),,"|ydeprec| Set mov/rot directly instead; kept only for backwards compat. If the 0th component of the vector is not NaN, then it was updated by the user, warning is issued and mov and rot are updated automatically."))
 		((Vector3r,mov,Vector3r::Zero(),,"Linear displacement step to be applied per iteration, by addition to :yref:`State.pos`."))
 		((Quaternionr,rot,Quaternionr::Identity(),,"Rotation step to be applied per iteration (via rotation composition with :yref:`State.ori`)."))
 		((bool,setVelocities,false,,"If true, velocity and angularVelocity are modified in such a way that over one iteration (dt), the body will have the prescribed jump. In this case, :yref:`position<State.pos>` and :yref:`orientation<State.ori>` itself is not updated for :yref:`dynamic<Body::dynamic>` bodies, since they would have the delta applied twice (here and in the :yref:`integrator<NewtonIntegrator>`). For non-dynamic bodies however, they *are* still updated."))