← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 1798: 1. Change syntax of python docstrings to restructured text instead of epytext (for future compati...

 

------------------------------------------------------------
revno: 1798
committer: Václav Šmilauer <eudoxos@xxxxxxxx>
branch nick: trunk
timestamp: Fri 2009-11-20 09:25:37 +0100
message:
  1. Change syntax of python docstrings to restructured text instead of epytext (for future compatibility)
  2. Workaround CPPPATH error saving option
  3. Make SpatialQuickSortCollider skip boundless bodies
  4. Fix rendering bodies with names (i.e. selectables)
modified:
  SConstruct
  doc/yade-epydoc.conf
  gui/qt3/YadeQtGeneratedMainWindow.ui
  pkg/common/Engine/StandAloneEngine/SpatialQuickSortCollider.cpp
  pkg/common/RenderingEngine/OpenGLRenderingEngine.cpp
  py/pack.py
  py/utils.py


--
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 'SConstruct'
--- SConstruct	2009-11-18 14:06:42 +0000
+++ SConstruct	2009-11-20 08:25:37 +0000
@@ -144,7 +144,7 @@
 	('buildPrefix','Where to create build-[version][variant] directory for intermediary files','..'),
 	EnumVariable('linkStrategy','How to link plugins together','per-class',['per-class','per-pkg[broken]','monolithic','static[broken]']),
 	('version','Yade version (if not specified, guess will be attempted)',None),
-	('CPPPATH', 'Additional paths for the C preprocessor (colon-separated)',None,None,colonSplit),
+	('CPPPATH', 'Additional paths for the C preprocessor (colon-separated)',None),
 	('LIBPATH','Additional paths for the linker (colon-separated)',None,None,colonSplit),
 	('QTDIR','Directories where to look for qt3',['/usr/share/qt3','/usr/lib/qt','/usr/lib/qt3','/usr/qt/3','/usr/lib/qt-3.3'],None,colonSplit),
 	('PATH','Path (not imported automatically from the shell) (colon-separated)',None,None,colonSplit),
@@ -160,6 +160,8 @@
 )
 opts.Update(env)
 opts.Save(optsFile,env)
+if env.has_key('CPPPATH'):
+	env['CPPPATH']=colonSplit(env['CPPPATH'])
 
 # do not propagate PATH from outside, to ensure identical builds on different machines
 #env.Append(ENV={'PATH':['/usr/local/bin','/bin','/usr/bin']})

=== modified file 'doc/yade-epydoc.conf'
--- doc/yade-epydoc.conf	2009-07-18 07:35:07 +0000
+++ doc/yade-epydoc.conf	2009-11-20 08:25:37 +0000
@@ -35,7 +35,7 @@
 
 # The default markup language for docstrings, for modules that do
 # not define __docformat__.  Defaults to epytext.
-docformat: epytext
+docformat: restructuredtext
 
 # Whether or not parsing should be used to examine objects.
 parse: yes
@@ -85,7 +85,7 @@
 css: white
 
 # The documented project's URL.
-url: http://yade.wikia.com
+url: http://www.launchpad.net/yade
 
 # HTML code for the project link in the navigation bar.  If left
 # unspecified, the project link will be generated based on the

=== modified file 'gui/qt3/YadeQtGeneratedMainWindow.ui'
--- gui/qt3/YadeQtGeneratedMainWindow.ui	2008-07-12 19:09:23 +0000
+++ gui/qt3/YadeQtGeneratedMainWindow.ui	2009-11-20 08:25:37 +0000
@@ -22,8 +22,8 @@
     </property>
     <property name="minimumSize">
         <size>
-            <width>244</width>
-            <height>128</height>
+            <width>230</width>
+            <height>111</height>
         </size>
     </property>
     <property name="caption">
@@ -58,14 +58,6 @@
                         <string>Controller</string>
                     </property>
                 </widget>
-                <widget class="QPushButton" row="1" column="0">
-                    <property name="name">
-                        <cstring>btPlayer</cstring>
-                    </property>
-                    <property name="text">
-                        <string>Player</string>
-                    </property>
-                </widget>
                 <widget class="QPushButton" row="0" column="0">
                     <property name="name">
                         <cstring>btGenerator</cstring>
@@ -101,27 +93,18 @@
         <slot>createGenerator()</slot>
     </connection>
     <connection>
+        <sender>btController</sender>
+        <signal>pressed()</signal>
+        <receiver>YadeQtGeneratedMainWindow</receiver>
+        <slot>createController()</slot>
+    </connection>
+    <connection>
         <sender>btQuit</sender>
         <signal>pressed()</signal>
         <receiver>YadeQtGeneratedMainWindow</receiver>
         <slot>Quit()</slot>
     </connection>
-    <connection>
-        <sender>btPlayer</sender>
-        <signal>pressed()</signal>
-        <receiver>YadeQtGeneratedMainWindow</receiver>
-        <slot>createPlayer()</slot>
-    </connection>
-    <connection>
-        <sender>btController</sender>
-        <signal>pressed()</signal>
-        <receiver>YadeQtGeneratedMainWindow</receiver>
-        <slot>createController()</slot>
-    </connection>
 </connections>
-<includes>
-    <include location="local" impldecl="in implementation">YadeQtGeneratedMainWindow.ui.h</include>
-</includes>
 <slots>
     <slot>closeController()</slot>
     <slot>createGenerator()</slot>

=== modified file 'pkg/common/Engine/StandAloneEngine/SpatialQuickSortCollider.cpp'
--- pkg/common/Engine/StandAloneEngine/SpatialQuickSortCollider.cpp	2009-11-18 10:24:57 +0000
+++ pkg/common/Engine/StandAloneEngine/SpatialQuickSortCollider.cpp	2009-11-20 08:25:37 +0000
@@ -43,21 +43,19 @@
 	shared_ptr<Body> b;
 	BodyContainer::iterator bi    = bodies->begin();
 	BodyContainer::iterator biEnd = bodies->end();
-	for(int i=0 ; bi!=biEnd ; ++bi,++i )
+	for(int i=0 ; bi!=biEnd ; ++bi)
 	{
 	   b = *bi;
+		if(!b->boundingVolume) continue;
 	   
-	   if(b->boundingVolume) 
-	   {
-	      min = b->boundingVolume->min;
-	      max = b->boundingVolume->max;
-	   }
-	   else
-	      min=max=b->physicalParameters->se3.position;
+	   min = b->boundingVolume->min;
+	   max = b->boundingVolume->max;
 
 	   rank[i]->id = b->getId();
 	   rank[i]->min = min;
 	   rank[i]->max = max;
+
+		i++;
 	}
 	
 	const shared_ptr<InteractionContainer>& interactions=ncb->interactions;

=== modified file 'pkg/common/RenderingEngine/OpenGLRenderingEngine.cpp'
--- pkg/common/RenderingEngine/OpenGLRenderingEngine.cpp	2009-11-18 13:34:36 +0000
+++ pkg/common/RenderingEngine/OpenGLRenderingEngine.cpp	2009-11-20 08:25:37 +0000
@@ -94,22 +94,20 @@
 }
 
 void OpenGLRenderingEngine::renderWithNames(const shared_ptr<MetaBody>& rootBody){
-	#ifdef YADE_SHAPE
 	FOREACH(const shared_ptr<Body>& b, *rootBody->bodies){
-		if(!b || !b->geometricalModel) continue;
+		if(!b || !b->interactingGeometry) continue;
 		glPushMatrix();
 		const Se3r& se3=b->physicalParameters->se3;
 		Real angle; Vector3r axis;	se3.orientation.ToAxisAngle(axis,angle);	
 		glTranslatef(se3.position[0],se3.position[1],se3.position[2]);
 		glRotatef(angle*Mathr::RAD_TO_DEG,axis[0],axis[1],axis[2]);
-		if(b->geometricalModel->getClassName() != "LineSegment"){ // FIXME: a body needs to say: I am selectable ?!?!
+		//if(b->interactingGeometry->getClassName() != "LineSegment"){ // FIXME: a body needs to say: I am selectable ?!?!
 			glPushName(b->getId());
-			geometricalModelDispatcher(b->geometricalModel,b->physicalParameters,/* always solid, not wireframe */false);
+			interactingGeometryDispatcher(b->interactingGeometry,b->physicalParameters,/* always solid, not wireframe */false);
 			glPopName();
-		}
+		//}
 		glPopMatrix();
 	}
-	#endif
 };
 
 bool OpenGLRenderingEngine::pointClipped(const Vector3r& p){

=== modified file 'py/pack.py'
--- py/pack.py	2009-11-13 11:27:22 +0000
+++ py/pack.py	2009-11-20 08:25:37 +0000
@@ -219,28 +219,28 @@
 	"""Generator of random dense packing with given geometry properties, using TriaxialTest (aperiodic)
 	or PeriIsoCompressor (periodic). The priodicity depens on whether	the spheresInCell parameter is given.
 
-	L{O.switchWorld()<Omega.switchWorld>} magic is used to have clean simulation for TriaxialTest without deleting the original simulation.
+	*O.switchWorld()* magic is used to have clean simulation for TriaxialTest without deleting the original simulation.
 	This function therefore should never run in parallel with some code accessing your simulation.
 
-	@param predicate: solid-defining predicate for which we generate packing
-	@param spheresInCell: if given, the packing will be periodic, with given number of spheres in the periodic cell.
-	@param radius: mean radius of spheres
-	@param rRelFuzz: relative fuzz of the radius -- e.g. radius=10, rRelFuzz=.2, then spheres will have radii 10 ± ½(10*.2)).
+	:param predicate: solid-defining predicate for which we generate packing
+	:param spheresInCell: if given, the packing will be periodic, with given number of spheres in the periodic cell.
+	:param radius: mean radius of spheres
+	:param rRelFuzz: relative fuzz of the radius -- e.g. radius=10, rRelFuzz=.2, then spheres will have radii 10 ± ½(10*.2)).
 		0 by default, meaning all spheres will have exactly the same radius.
-	@param cropLayers: (aperiodic only) how many layers of spheres will be added to the computed dimension of the box so that there no
+	:param cropLayers: (aperiodic only) how many layers of spheres will be added to the computed dimension of the box so that there no
 		(or not so much, at least) boundary effects at the boundaries of the predicate.
-	@param dim: dimension of the packing, to override dimensions of the predicate (if it is infinite, for instance)
-	@param memoizeDb: name of sqlite database (existent or nonexistent) to find an already generated packing or to store
+	:param dim: dimension of the packing, to override dimensions of the predicate (if it is infinite, for instance)
+	:param memoizeDb: name of sqlite database (existent or nonexistent) to find an already generated packing or to store
 		the packing that will be generated, if not found (the technique of caching results of expensive computations
 		is known as memoization). Fuzzy matching is used to select suitable candidate -- packing will be scaled, rRelFuzz
 		and dimensions compared. Packing that are too small are dictarded. From the remaining candidate, the one with the
 		least number spheres will be loaded and returned.
-	@param useOBB: effective only if a inGtsSurface predicate is given. If true (default), oriented bounding box will be
+	:param useOBB: effective only if a inGtsSurface predicate is given. If true (default), oriented bounding box will be
 		computed first; it can reduce substantially number of spheres for the triaxial compression (like 10× depending on
 		how much asymmetric the body is), see scripts/test/gts-triax-pack-obb.py.
-	@param memoDbg: show packigns that are considered and reasons why they are rejected/accepted
+	:param memoDbg: show packigns that are considered and reasons why they are rejected/accepted
 
-	@return: SpherePack object with spheres, filtered by the predicate.
+	:return: SpherePack object with spheres, filtered by the predicate.
 	"""
 	import sqlite3, os.path, cPickle, time, sys, _packPredicates
 	from yade import log

=== modified file 'py/utils.py'
--- py/utils.py	2009-11-19 06:44:50 +0000
+++ py/utils.py	2009-11-20 08:25:37 +0000
@@ -105,12 +105,12 @@
 def wall(position,axis,sense=0,color=None,physParamsClass='BodyMacroParameters',**physParamsAttr):
 	"""Return ready-made wall body.
 
-	@param position: float or Vector3 specifying center of the wall. If float, it is the position along given axis, the other 2 components being zero
-	@param axis: orientation of the wall normal (0,1,2) for x,y,z (sc. planes yz, xz, xy)
-	@param sense: sense in which to interact (0: both, -1: negative, +1: positive; see Wall reference documentation)
-	@return: Body instance
+	:param position: float or Vector3 specifying center of the wall. If float, it is the position along given axis, the other 2 components being zero
+	:param axis: orientation of the wall normal (0,1,2) for x,y,z (sc. planes yz, xz, xy)
+	:param sense: sense in which to interact (0: both, -1: negative, +1: positive; see Wall reference documentation)
+	:return: Body instance
 
-	Note: GeometricalModel is not set.
+	.. note: GeometricalModel is not set.
 	"""
 	b=Body()
 	pp=bodiesPhysDefaults.copy(); pp.update(physParamsAttr)