00001 #ifndef SCENE_H
00002 #define SCENE_H
00003
00004 #include <iostream>
00005 #include <string>
00006 #include <vector>
00007 #include <set>
00008 #include <map>
00009 #include <stdlib.h>
00010 #include <stdio.h>
00011
00012 #include "Part.h"
00013 #include "Curve.h"
00014 #include "Surface.h"
00015 #include "Loft.h"
00016 #include "Assembly.h"
00017 #include "Connection.h"
00018
00019 #include "DH_Chain.h"
00020
00021
00022
00023 template <class DataType, int dim>
00024 class SceneBase {
00025 typedef SceneBase<DataType,dim> base;
00026 public:
00027 typedef Assembly<DataType,dim> AssemblyType;
00028 typedef Part<DataType,dim> PartType;
00029 typedef Curve<DataType,dim> CurveType;
00030 typedef Surface<DataType> SurfaceType;
00031 typedef Loft<DataType> LoftType;
00032 typedef Segment<DataType,dim> SegmentType;
00033 typedef Facet<DataType> FacetType;
00034
00035 typedef Joint<DataType,dim> JointType;
00036 typedef DH_Link<DataType,dim> LinkType;
00037 typedef DH_Chain<DataType,dim> ChainType;
00038
00039 typedef ads::FixedArray<dim,DataType> point_type;
00040 typedef ads::FixedArray<dim,int> multi_index_type;
00041
00042 friend class DH_Link<DataType,dim>;
00043
00044
00045 SceneBase() {
00046 idTag.clear();
00047 idTag.push_back(-1);
00048
00049 assemblies.resize(0);
00050 surfaces.resize(0);
00051 lofts.resize(0);
00052
00053 DH_Joints.resize(0);
00054 DH_Links.resize(0);
00055 DH_Chains.resize(0);
00056 PType o(0.), z(0.), x(0.);
00057 z(2) = 1.; x(1) = 1.;
00058 int t=0;
00059 CoordFrame = JointType(o,z,x,t,idTag);
00060 CoordFrame.setId(0);
00061 edges.resize(0);
00062 component = -1;
00063 backedge = -1;
00064 gdistance = -1;
00065
00066 name_size = 0;
00067 idTag_size = 0;
00068
00069 }
00070
00071
00072 ~SceneBase() {}
00073
00074 virtual std::string Name() { return name; }
00075 virtual void setName(std::string val) { name = val; }
00076
00077 virtual std::vector<int>& IdTag() { return idTag; }
00078
00079 virtual void AddSurface( SurfaceType& v) {
00080 std::vector<int> tmpId;
00081 tmpId = idTag;
00082 tmpId.push_back( -(surfaces.size()+1) );
00083 v.setIdTag(tmpId);
00084 v.setIdTag(tmpId);
00085 printID(v.IdTag());
00086 base::surfaces.push_back(v);
00087 }
00088
00089 virtual int GetNumSurfaces() {
00090 return ((int) surfaces.size());
00091 }
00092 virtual SurfaceType * GetNthSurface(int n) {
00093 return (&surfaces[n]);
00094 }
00095
00096 virtual void AddAssembly( AssemblyType * v) {
00097 std::vector<int> tmpId;
00098 tmpId.push_back( assemblies.size() );
00099 v->setIdTag(tmpId);
00100
00101 assemblies.push_back(*v);
00102
00103 }
00104
00105 virtual void AddAssembly( AssemblyType& v) {
00106 std::vector<int> tmpId;
00107 tmpId.push_back( assemblies.size() );
00108 v.setIdTag(tmpId);
00109
00110 assemblies.push_back(v);
00111
00112 ( mklog() << " \t== " << Name() << " added an Assembly. assemblies.size() " << assemblies.size() << std::endl).flush();
00113 #ifdef SCENE_DEBUG_ON
00114 ( mklog() << " \t= " << Name() << " added an Assembly. assemblies.size() " << assemblies.size() << std::endl).flush();
00115 #endif
00116 }
00117 virtual int GetNumAssemblies() { return ((int) assemblies.size()); }
00118 virtual AssemblyType& GetNthSceneAssembly(int n) {
00119 return (assemblies[n]);
00120 }
00121 virtual AssemblyType * GetNthAssembly(int n) {
00122 return &(assemblies[n]);
00123 }
00124
00125 virtual void addJoint( JointType * joint) {
00126 joint->id = DH_Joints.size();
00127 DH_Joints.push_back(*joint);
00128 }
00129 virtual void addJoint( JointType& joint) { addJoint(&joint); }
00130 virtual int GetNumJoints() { return ((int) DH_Joints.size()); }
00131 virtual JointType * GetNthJoint(int n) { return (&DH_Joints[n]); }
00132 JointType * GetCoordFrame() { return &CoordFrame; }
00133
00134 virtual void addLink( LinkType * cLink) {
00135 cLink->id = DH_Links.size();
00136 DH_Links.push_back(*cLink);
00137 }
00138 virtual void addLink( LinkType& cLink) { addLink(&cLink); }
00139 virtual int GetNumLinks() { return ((int) DH_Links.size()); }
00140 virtual LinkType * GetNthLink(int n) { return (&DH_Links[n]); }
00141
00142 virtual void AddChain( ChainType * chain) {
00143 DH_Chains.push_back(*chain);
00144 DH_Chains[DH_Chains.size()-1].setId(DH_Chains.size()-1);
00145 }
00146 virtual void AddChain( ChainType& chain) { AddChain(&chain); }
00147 virtual int GetNumChains() { return ((int) DH_Chains.size()); }
00148 virtual ChainType * GetNthChain(int n) { return (&DH_Chains[n]); }
00149
00150 void updateScene(DataType dt, DataType time) {
00151 MType transform(dim+1,dim+1);
00152 int level = -1;
00153 transform.assign(imatrix(dim+1));
00154 for (register int a = 0; a < GetNumAssemblies(); a++) {
00155 #ifdef SCENE_DEBUG_ON
00156 printf("///// Updating Assembly %d %s NumParts %d\n",a,GetNthSceneAssembly(a).Name().c_str(),GetNthSceneAssembly(a).GetNumParts() );
00157 #endif
00158 GetNthSceneAssembly(a).updateAssembly(dt,time, transform, level);
00159 }
00160 }
00161
00162 void resetScene() {
00163 for (register int a = 0; a < GetNumAssemblies(); a++) {
00164 #ifdef SCENE_DEBUG_ON
00165 printf("///// Reseting Assembly %d %s NumParts %d\n",a,GetNthSceneAssembly(a).Name().c_str(),GetNthSceneAssembly(a).GetNumParts() );
00166 #endif
00167 GetNthSceneAssembly(a).resetAssembly();
00168 }
00169 }
00170
00171 int GetNumPoints() {
00172 int count = 0;
00173 for (register int a = 0; a < GetNumAssemblies(); a++) {
00174 #ifdef SCENE_DEBUG_ON
00175 printf("///// Counting Assembly %d %s NumParts %d\n",a,GetNthSceneAssembly(a).Name().c_str(),GetNthSceneAssembly(a).GetNumParts() );
00176 #endif
00177 count += GetNthSceneAssembly(a).GetNumPoints();
00178 }
00179 return count;
00180 }
00181
00182 void GetNumPC(int& pcount, int& ccount) {
00183 pcount = 0;
00184 ccount = 0;
00185 for (register int a = 0; a < GetNumAssemblies(); a++) {
00186 #ifdef SCENE_DEBUG_ON
00187 printf("///// Counting Assembly %d %s NumParts %d\n",a,GetNthSceneAssembly(a).Name().c_str(),GetNthSceneAssembly(a).GetNumParts() );
00188 #endif
00189 GetNthSceneAssembly(a).GetNumPC(pcount,ccount);
00190 }
00191 }
00192
00193 virtual AssemblyType * GetAssembly(std::vector<int> AidTag) {
00194 AssemblyType * assemTmp;
00195 assemTmp = &assemblies[AidTag[0]];
00196
00197 for (register int i = 1; i < int(AidTag.size()); i++) {
00198 assemTmp = assemTmp->GetNthSubAssembly(AidTag[i]);
00199 }
00200
00201 return assemTmp;
00202 }
00203
00204 virtual PartType * GetPart(std::vector<int> PidTag) {
00205 AssemblyType * assemTmp;
00206 PartType * partTmp;
00207 assemTmp = &assemblies[PidTag[0]];
00208
00209 if (PidTag[1]>=0) {
00210 for (int i = 1; i < int(PidTag.size())-1; i++) {
00211 if (PidTag[i]<0) break;
00212 assemTmp = assemTmp->GetNthSubAssembly(PidTag[i]);
00213 }
00214 }
00215 partTmp = assemTmp->GetNthPart(-PidTag[PidTag.size()-1]-1);
00216 return partTmp;
00217 }
00218
00219 void poseChain(int n) {
00220 ChainType * ctmp, * cParent;
00221 ctmp = &DH_Chains[n];
00222 LinkType * childLink, * parentLink;
00223 std::vector<int> childIdTag;
00224 MType DHMatTmp(dim+1,dim+1), iTmp(dim+1,dim+1) ;
00225 DHMatTmp.assign(imatrix(dim+1));
00226 iTmp.assign(imatrix(dim+1));
00227 int ternary = 0;
00228 #ifdef SCENE_DEBUG_ON
00229 ( mklog() << "\n===========\n POSE CHAIN # " << n << "\n===========\n"
00230 << " ctmp->links.size() " << ctmp->links.size() << std::endl
00231 << " ctmp->terNlinks.size() " << ctmp->terNlinks.size() << std::endl).flush();
00232 #endif
00233
00234 for (register int i = 0; i < int(ctmp->links.size()); i ++) {
00235 childIdTag = ctmp->links[i]->child->CFidTag;
00236 #ifdef SCENE_DEBUG_ON
00237 ( mklog() << " link " << i << " childIdTag " ).flush();
00238 printID(childIdTag);
00239 ( mklog() << std::endl ).flush();
00240 #endif
00241 if ( i == 0) {
00242 if (ctmp->getParentChain() >= 0) {
00243 cParent = &DH_Chains[ctmp->getParentChain()];
00244 DHMatTmp = prod(DHMatTmp, cParent->tipDHMat);
00245 }
00246 else {
00247 DHMatTmp = DH_Links[-ctmp->getParentChain()-1].DHMat;
00248 }
00249 }
00250 DHMatTmp = prod(DHMatTmp, ctmp->links[i]->DHMat);
00251
00253 for (register int j = 0; j < int(ctmp->terNlinks.size()); j ++) {
00255 if ( ctmp->terNlinks[j][0] == ctmp->links[i]->id ) {
00256 ternary = 1;
00257 childIdTag = ctmp->natives[ ctmp->terNlinks[j][1] ]->child->CFidTag;
00258 childLink = ctmp->natives[ ctmp->terNlinks[j][1] ];
00260 if ( childIdTag[childIdTag.size()-1] < 0 ) {
00261 GetPart(childIdTag)->setDHMat( prod(DHMatTmp, childLink->DHMat) );
00262 }
00263 else {
00264 }
00265 }
00266 }
00268 if (ternary == 0) {
00269 if (i == int(ctmp->links.size())-1) {
00270 ctmp->tipDHMat = DHMatTmp;
00271 }
00272 childIdTag = ctmp->links[i]->child->CFidTag;
00274 if ( childIdTag[childIdTag.size()-1] < 0 ) {
00275 childLink = ctmp->links[i];
00276 if (i > 0) {
00277 GetPart(childIdTag)->setDHMat( DHMatTmp );
00278 }
00279 else {
00280 if (ctmp->getParentChain() >= 0) {
00281 cParent = &DH_Chains[ctmp->getParentChain()];
00282 ( mklog() << cParent->id << std::endl).flush();
00283 parentLink = cParent->GetNthLink(ctmp->GetNumLinks());
00284 GetPart(childIdTag)->setDHMat( parentLink->DHMat );
00285 }
00286 else {
00287 childIdTag = ctmp->links[i]->parent->CFidTag;
00288 GetPart(childIdTag)->setDHMat( DH_Links[-ctmp->getParentChain()-1].DHMat);
00289 }
00290 }
00291 }
00292 else {
00293 childLink = ctmp->links[i];
00294 GetAssembly(childIdTag)->setDHMat( prod(DHMatTmp, childLink->DHMat) );
00295 }
00296 }
00297
00298 ternary = 0;
00299 }
00300 }
00301
00303 virtual void outputScene(int type, DataType time, std::string file) {
00304
00305 #ifdef SCENE_DEBUG_ON
00306 printf("Output %s type = %d dim = %d\n",file.c_str(),type,dim);
00307 #endif
00308 switch(type) {
00309 case PartType::pointList: {
00310
00311 break;
00312 }
00313 case PartType::VTK_curve: {
00314
00315 break;
00316 }
00317 case PartType::Brep2D: {
00318
00319 break;
00320 }
00321 case PartType::VTK_PL: {
00322
00323 break;
00324 }
00325 case PartType::Brep3D: {
00326 FILE * fout;
00327 fout = fopen (file.c_str(),"w");
00328 if (fout == NULL) { printf("%s could not be opened.\n",file.c_str() ); return; }
00329
00330 int totPoints=0, totSegs=0, pp=0;
00331
00332 const FacetType * facetTmp;
00333 const PartType * partTmp;
00334 #ifdef SCENE_DEBUG_ON
00335 printf("Writing Brep3D\n");
00336 #endif
00337 for (register int a = 0; a < GetNumAssemblies(); a++) {
00338 #ifdef SCENE_DEBUG_ON
00339 printf("Assembly %d %s NumParts %d\n",a,GetNthSceneAssembly(a).Name().c_str(),GetNthSceneAssembly(a).GetNumParts() );
00340 #endif
00341 pp += GetNthSceneAssembly(a).GetNumParts();
00342 for (register int sa = 0; sa < GetNthSceneAssembly(a).GetNumSubAssemblies(); sa++) {
00343 #ifdef SCENE_DEBUG_ON
00344 printf("Assembly %d %s NumSubAssemblies %d\n",a,GetNthSceneAssembly(a).Name().c_str(),GetNthSceneAssembly(a).GetNumSubAssemblies() );
00345 #endif
00346 pp += GetNthSceneAssembly(a).GetNthSubAssembly(sa)->GetNumParts();
00347 }
00348 }
00349 #ifdef SCENE_DEBUG_ON
00350 printf("Total number of Parts = %d\n",pp);
00351 #endif
00352 int pointCount[pp];
00353
00354 pp = 0;
00355 for (register int a = 0; a < GetNumAssemblies(); a++) {
00356 for (register int p = 0; p < GetNthSceneAssembly(a).GetNumParts(); p++) {
00357 partTmp = GetNthSceneAssembly(a).GetNthPart(p);
00358 pointCount[pp] = totPoints;
00359 totPoints += partTmp->GetNumPoints();
00360 totSegs += partTmp->GetNumConnections();
00361
00362
00363 pp++;
00364 }
00365 for (register int sa = 0; sa < GetNthSceneAssembly(a).GetNumSubAssemblies(); sa++) {
00366
00367
00368 for (register int p = 0; p < GetNthSceneAssembly(a).GetNthSubAssembly(sa)->GetNumParts(); p++) {
00369 partTmp = GetNthSceneAssembly(a).GetNthSubAssembly(sa)->GetNthPart(p);
00370 pointCount[pp] = totPoints;
00371 totPoints += partTmp->GetNumPoints();
00372 totSegs += partTmp->GetNumConnections();
00373
00374
00375 pp++;
00376 }
00377
00378 }
00379
00380 }
00381
00382 pp=0;
00383 fprintf(fout,"3 2\n%d\n",totPoints );
00384 for (register int a = 0; a < GetNumAssemblies(); a++) {
00385
00386 GetNthSceneAssembly(a).outputAssembly_Brep3D(time,0,pointCount,pp,fout);
00387 for (register int p = 0; p < GetNthSceneAssembly(a).GetNumParts(); p++) {
00388 #ifdef SCENE_DEBUG_ON
00389 printf("Part %d %s numPoints %d\n",p,GetNthSceneAssembly(a).GetNthPart(p)->Name().c_str(),GetNthSceneAssembly(a).GetNthPart(p)->GetNumPoints() );
00390 #endif
00391 partTmp = GetNthSceneAssembly(a).GetNthPart(p);
00392 for (register int j=0; j < partTmp->GetNumPoints(); j ++) {
00393
00394
00395 fprintf(fout,"%10d %8.5e %8.5e %8.5e\n",j,
00396 partTmp->GetNthPoint(j)(0),partTmp->GetNthPoint(j)(1),partTmp->GetNthPoint(j)(2) );
00397 }
00398 }
00399 for (register int sa = 0; sa < GetNthSceneAssembly(a).GetNumSubAssemblies(); sa++) {
00400
00401 for (register int p = 0; p < GetNthSceneAssembly(a).GetNthSubAssembly(sa)->GetNumParts(); p++) {
00402 partTmp = GetNthSceneAssembly(a).GetNthSubAssembly(sa)->GetNthPart(p);
00403
00404 for (register int j=0; j < partTmp->GetNumPoints(); j ++) {
00405 fprintf(fout,"%10d %8.5e %8.5e %8.5e\n",j,
00406 partTmp->GetNthPoint(j)(0),partTmp->GetNthPoint(j)(1),partTmp->GetNthPoint(j)(2) );
00407 }
00408 }
00409 }
00410 }
00411
00412 fprintf(fout,"%d\n",totSegs );
00413 pp=0;
00414 for (register int a = 0; a < GetNumAssemblies(); a++) {
00415
00416 GetNthSceneAssembly(a).outputAssembly_Brep3D(time,1,pointCount,pp,fout);
00417 for (register int p = 0; p < GetNthSceneAssembly(a).GetNumParts(); p++) {
00418
00419 partTmp = GetNthSceneAssembly(a).GetNthPart(p);
00420 for (register int j = 0; j < partTmp->GetNumConnections(); j++) {
00421 facetTmp = (partTmp->GetNthFacet(j));
00422 fprintf(fout,"%d\t%d\t%d\n",
00423 facetTmp->getNthCon(0)+pointCount[pp],facetTmp->getNthCon(1)+pointCount[pp],
00424 facetTmp->getNthCon(2)+pointCount[pp] );
00425 }
00426 pp++;
00427 }
00428 for (register int sa = 0; sa < GetNthSceneAssembly(a).GetNumSubAssemblies(); sa++) {
00429
00430 for (register int p = 0; p < GetNthSceneAssembly(a).GetNthSubAssembly(sa)->GetNumParts(); p++) {
00431 partTmp = GetNthSceneAssembly(a).GetNthSubAssembly(sa)->GetNthPart(p);
00432
00433 for (register int j = 0; j < partTmp->GetNumConnections(); j++) {
00434 facetTmp = (partTmp->GetNthFacet(j));
00435 fprintf(fout,"%d\t%d\t%d\n",
00436 facetTmp->getNthCon(0)+pointCount[pp],facetTmp->getNthCon(1)+pointCount[pp],
00437 facetTmp->getNthCon(2)+pointCount[pp] );
00438 }
00439 pp++;
00440 }
00441 }
00442
00443 }
00444
00445 fclose (fout);
00446 break;
00447 }
00448 case PartType::STL: {
00449 FILE * fout;
00450 fout = fopen (file.c_str(),"w");
00451 if (fout == NULL) return;
00452 #ifdef SCENE_DEBUG_ON
00453 ( mklog() << "write STL\n").flush();
00454 #endif
00455 for (register int a = 0; a < GetNumAssemblies(); a++) {
00456
00457 GetNthSceneAssembly(a).outputAssembly_STL(time,fout);
00458 }
00459 fclose (fout);
00460 break;
00461 }
00462 case PartType::VelDat: {
00463 FILE * fout;
00464 fout = fopen (file.c_str(),"w");
00465 if (fout == NULL) return;
00466
00467 #ifdef SCENE_DEBUG_ON
00468 ( mklog() << "___WRITE VELDAT___\n" << " GetNumAssemblies() = " << GetNumAssemblies() << std::endl).flush();
00469 #endif
00470 for (register int a = 0; a < GetNumAssemblies(); a++) {
00471
00472
00473 }
00474 fclose (fout);
00475 break;
00476 }
00477 }
00478 }
00480
00481 void partPressureForces( multi_index_type* cons, DataType* press, DataType scale ) {
00482 #ifdef SCENE_DEBUG_ON
00483 printf("SCENE: CALC PART PRESSURE FORCES\n");
00484 #endif
00485
00486 for (register int a = 0; a < GetNumAssemblies(); a++) {
00487 GetNthSceneAssembly(a).partPressureForces(cons, press, scale );
00488
00489 }
00490
00491
00492 }
00493
00494 void send2CPT_4(point_type* vertices, multi_index_type* connections, DataType scale) {
00495
00496
00497 #ifdef SCENE_DEBUG_ON
00498 printf("Sending Brep3D 4+++++++++++\n");
00499 #endif
00500 int totPoints = 0, totConnections = 0;
00501
00502 for (register int a = 0; a < GetNumAssemblies(); a++) {
00503
00504 GetNthSceneAssembly(a).send2CPT(totPoints, totConnections, vertices, connections, scale);
00505
00506
00507 }
00508
00509
00510
00511 }
00512
00513 void vel2CPT_2(point_type* velocities, DataType scale) {
00514 int totPoints = 0;
00515 for (register int a = 0; a < GetNumAssemblies(); a++) {
00516 GetNthSceneAssembly(a).vel2CPT(totPoints, velocities, scale);
00517 }
00518 }
00519
00520 virtual void Restart(std::ifstream& ifs, int& pos, double& t, double& dt) {
00521 ( mklog() << "\nRestarting SCENE " << Name() << " time= "<< t << " dt = " << dt << std::endl).flush();
00522 ifs.seekg(pos);
00523 ifs.read((char*)&num_assemblies,sizeof(int));
00524
00525 ifs.read((char*)&num_chains,sizeof(int));
00526 pos = ifs.tellg();
00527
00528 ( mklog() << "num_curves " << num_curves << " num_surfaces " << num_surfaces
00529 << " num_lofts " << num_lofts << " num_assemblies " << num_assemblies
00530 << " num_joints " << num_joints << " num_chains " << num_chains << std::endl).flush();
00531
00532 for (register int i=0; i<num_assemblies; i++) {
00533 assemblies[i].Restart(ifs,pos,t,dt);
00534 pos = ifs.tellg();
00535 }
00536 for (register int i=0; i<num_chains; i++) {
00537 DH_Chains[i].Restart(ifs,pos,t,dt);
00538 pos = ifs.tellg();
00539 }
00540 #ifdef CHECKRESTART_DEBUG_ON
00541 ( mklog() << "\nDone Restarting Scene " << Name() << " t = " << t << " dt = " << dt << " pos = " << pos << std::endl).flush();
00542 #endif
00543 }
00544
00545 virtual void Checkpointing(std::ofstream& ofs) {
00546 #ifdef CHECKRESTART_DEBUG_ON
00547 ( mklog() << "\nCHECKPOINTING SCENE " << std::endl).flush();
00548 #endif
00549 name_size=name.size();
00550 idTag_size=idTag.size();
00551
00552 num_curves = curves.size();
00553 num_surfaces = surfaces.size();
00554 num_lofts = lofts.size();
00555 num_assemblies = assemblies.size();
00556
00557 ofs.write((char*)&num_assemblies,sizeof(int));
00558
00559 num_joints = DH_Joints.size();
00560 num_links = DH_Links.size();
00561 num_chains = DH_Chains.size();
00562
00563 ofs.write((char*)&num_chains,sizeof(int));
00564 #ifdef CHECKRESTART_DEBUG_ON
00565 ( mklog() << "num_curves " << num_curves << " num_surfaces " << num_surfaces
00566 << " num_lofts " << num_lofts << " num_assemblies " << num_assemblies
00567 << " num_joints " << num_joints << " num_chains " << num_chains << std::endl).flush();
00568 #endif
00569 for (register int i=0; i<num_assemblies; i++) {
00570 assemblies[i].Checkpointing(ofs);
00571 }
00572
00573 for (register int i=0; i<num_chains; i++) {
00574 DH_Chains[i].Checkpointing(ofs);
00575 }
00576
00577 }
00578
00579 virtual void logPartLoads( std::ofstream& ofs, DataType time_, int steps ) {
00580 #ifdef SCENE_DEBUG_ON
00581 printf("SCENE: logPartLoads()\n");
00582 #endif
00583 for (register int a = 0; a < GetNumAssemblies(); a++) {
00584 GetNthSceneAssembly(a).logPartLoads( ofs, time_, steps );
00585 }
00586 }
00587
00588 virtual void printSummary() {
00589 #ifdef SCENE_DEBUG_ON
00590 printf("SCENE: printSummary()\n");
00591 #endif
00592 std::cout << "Scene " << name << " has " << GetNumAssemblies() << " assemblies\n";
00593 ( mklog() << "Scene " << name << " has " << GetNumAssemblies() << " assemblies\n").flush();
00594 for (register int a = 0; a < GetNumAssemblies(); a++) {
00595 GetNthSceneAssembly(a).printSummary(1);
00596 }
00597 }
00598
00599 protected:
00600 std::vector<int> idTag;
00601 std::string name;
00602 std::vector<CurveType > curves;
00603 std::vector<SurfaceType > surfaces;
00604 std::vector<LoftType > lofts;
00605 std::vector<AssemblyType > assemblies;
00606
00607 int num_curves, num_surfaces, num_lofts, num_assemblies;
00608 int num_joints, num_links, num_chains;
00609
00610
00611 std::vector<JointType > DH_Joints;
00612 std::vector<LinkType > DH_Links;
00613 std::vector<ChainType > DH_Chains;
00614 JointType CoordFrame;
00615
00616
00617 std::vector<int> edges;
00618 int component;
00619 int backedge;
00620 int gdistance;
00621
00622 int name_size, idTag_size;
00623
00624
00625 };
00626
00627 template <class DataType, int dim>
00628 class Scene : public SceneBase<DataType,dim> {
00629 public:
00630 typedef SceneBase<DataType,dim> base;
00631 Scene() { base(); }
00632 ~Scene() {}
00633
00634 protected:
00635
00636 };
00637
00638 template <class DataType>
00639 class Scene<DataType,2> : public SceneBase<DataType,2> {
00640
00641 public:
00642 typedef SceneBase<DataType,2> base;
00643
00644 Scene() { base(); }
00645 ~Scene() {}
00646
00647 protected:
00648
00649 };
00650
00651 template <class DataType>
00652 class Scene<DataType,3> : public SceneBase<DataType,3> {
00653
00654 public:
00655 typedef SceneBase<DataType,3> base;
00656
00657 Scene() { base(); }
00658 ~Scene() {}
00659
00660 protected:
00661
00662 };
00663
00664 #endif // SCENE_H