void ComponentPhysicsGeom::load(const PropertyBag &data) { resetMembers(); desiredHeight = data.getFloat("height"); collisionRadius = data.getFloat("radius"); // Create as physics geometry if(geom){dGeomDestroy(geom);} geom=0; createGeom(data.getString("physicsGeometryType")); // Set initial position { vec3 position; if(data.get("position", position)) // optional tag { setPosition(position); } } // Declare the initial state getParentBlackBoard().relayMessage(MessagePositionHasBeenSet(getPosition())); getParentBlackBoard().relayMessage(MessageOrientationHasBeenSet(getOrientation())); getParentBlackBoard().relayMessage(MessageRequestSetHeight(desiredHeight)); }
int main (int argc, char* argv[]) { std::vector<std::vector<Module*>* > myGeom; tests(myGeom); createGeom(myGeom); //createGeomLite(myGeom); return 0; }
//************************************************************* void MINDsetup::init(bhep::gstore pstore, bhep::prlevel level) { //************************************************************* _msetup=bhep::messenger(level); _msetup.message("++MINDsetup Messenger generated++",bhep::VERBOSE); _pstore=pstore; readParam(); //--------------- generate recpack setup -----------// _gsetup.set_name("main"); // create volumes and surfaces createGeom(); // define detector resolutions setResolution(); // add properties to volumes and surfaces addProperties(); // std::cout << _gsetup.volume("Detector").parameter("BField") << std::endl; // dict::mixdictionary smell = _gsetup.volume_properties("IRON_plane0"); // const double XX = _gsetup.volume_properties("IRON_plane0").retrieve(thing_name); // std::cout << _gsetup.volume_properties("IRON_plane0").retrieve(thing_name) << std::endl; // std::cout << _gsetup << std::endl; _msetup.message("++ Setup has been generated !! ++",bhep::VERBOSE); //_msetup.message("MIND Setup:", _gsetup,bhep::VERBOSE); }
int main( void ) { osg::osgInit( 0, NULL ); osg::Pnt3f pnt[8] = { Pnt3f(-1,-1, 1), Pnt3f( 1,-1, 1), Pnt3f( 1, 1, 1), Pnt3f(-1, 1, 1), Pnt3f(-1,-1,-1), Pnt3f( 1,-1,-1), Pnt3f( 1, 1,-1), Pnt3f(-1, 1,-1) }; unsigned int face[6][col::Dop::NumOri] = { {0,1,2,3}, {1,5,6,2}, {2,6,7,3}, {0,3,7,4}, {0,4,5,1}, {4,7,6,5} }; unsigned int face_nv[6] = { 4, 4, 4, 4, 4, 4 }; col::Topology topo1( face, 6, face_nv ); puts("\nCube from array:\n"); puts("points:"); for ( int i = 0; i < 8; i ++ ) col::printPnt( pnt[i] ); puts("topology:"); topo1.print(); osg::GeometryPtr geom; geom = createGeom( OBJ_PLANE, 3 ); col::Topology topo2( geom ); puts("\nPlane:\n"); puts("points:"); printPoints( geom ); puts("topology:"); topo2.print(); geom = createGeom( OBJ_SPHERE, 1 ); col::Topology topo3( geom ); puts("\nSphere:\n"); puts("points:"); printPoints( geom ); puts("topology:"); topo3.print(); geom = createGeom( OBJ_TORUS, 3 ); col::Topology topo4( geom, true, 1E-4 ); puts("\nTorus with vertex unification:\n"); puts("points:"); printPoints( geom ); puts("topology:"); topo4.print(); geom = createGeom( OBJ_TORUS, 3 ); topo4.createFromGeom( geom, false, 0 ); puts("\nTorus without vertex unification:\n"); puts("points:"); printPoints( geom ); puts("topology:"); topo4.print(); geom = createGeom( OBJ_BOX, 0 ); col::Topology topo5( geom ); // does not do unification by default puts("\nBox:\n"); puts("points:"); printPoints( geom ); puts("topology:"); topo5.print(); return 0; }