00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef AMROC_V3VISUALGRID_H
00010 #define AMROC_V3VISUALGRID_H
00011
00019 #include "VisualGrid.h"
00020 #include "HDFToV3/V3VisualGridBase.h"
00021 #include "HDFToV3/V3VisualGridData.h"
00022
00023 #define NSURF 6
00024
00025
00026
00027 int strcpn(char* str1, char* str2) {
00028 register int i = 0;
00029 while (str2[i]!='\0') {
00030 str1[i] = str2[i];
00031 i++;
00032 }
00033 return i;
00034 }
00035
00036
00037
00038
00039 int strcpb( char* str1, const char* str2, int len ) {
00040 register int i = 0, j;
00041 while (str2[i] != '\0') {
00042 str1[i] = str2[i];
00043 i++;
00044 }
00045 for (j=i; j < len; j++) str1[j] = ' ';
00046 return i;
00047 }
00048
00049
00056 template <class VectorType>
00057 class V3VisualGrid : public V3VisualGridBase, public VisualGrid<VectorType> {
00058 typedef typename VectorType::InternalDataType DataType;
00059 typedef VisualGrid<VectorType> base;
00060
00061 public:
00062 typedef typename base::data_block_type database_block_type;
00063 typedef V3VisualGridData<VectorType> data_block_type;
00064 typedef typename base::block_list_type blockbase_list_type;
00065 typedef std::vector<data_block_type*> block_list_type;
00066 typedef typename base::evaluator_type evaluator_type;
00067 typedef typename base::hierarchy_storage_type hierarchy_storage_type;
00068 typedef typename base::hdata_block_type hdata_block_type;
00069
00070 typedef std::pair<int, int> node_pair_type;
00071 typedef std::multimap<int, int> node_pair_list_type;
00072
00073 public:
00074 V3VisualGrid(evaluator_type* ev) : V3VisualGridBase(ev), base(ev),
00075 _Equiv(0), _PlotCrossSection(0) {
00076 for (int s=0; s<NSURF; s++)
00077 SurfaceDisp[s] = 1;
00078 base::_BlockList = (blockbase_list_type *) new block_list_type;
00079 base::Make3d = true;
00080 }
00081
00082 virtual ~V3VisualGrid() {
00083 for (typename block_list_type::iterator bit=BlockList().begin();
00084 bit!=BlockList().end(); bit++)
00085 delete (*bit);
00086 BlockList().clear();
00087 delete base::_BlockList;
00088 }
00089
00090 virtual void update() {
00091 std::string iname;
00092 if (UpdateName()) iname = *UpdateName();
00093 else iname = "display.in";
00094
00095
00096 std::ifstream infile;
00097 std::ofstream outfile;
00098 infile.open(iname.c_str(), std::ios::in);
00099 if (!infile) {
00100 if (!UpdateName()) {
00101 outfile.open(iname.c_str(), std::ios::out);
00102 outfile << "Type 6\nUseEquiv 1\n\nDisplayMinLevel 0\nDisplayMaxLevel 10\n\n";
00103 outfile << "ScriptBegin {\n movewindow 7,2000,0\n";
00104 outfile << " Edgesofftransparenton\n}\n";
00105 outfile.close();
00106 }
00107 }
00108 else{
00109 infile.close();
00110 }
00111
00112 ControlDevice DisplayCtrl(GetFileControlDevice(iname.c_str(),""));
00113 RegisterAt(DisplayCtrl,"Type",base::_FKeys);
00114 RegisterAt(DisplayCtrl,"UseEquiv",_Equiv);
00115 RegisterAt(DisplayCtrl,"DisplayMinLevel",base::_MinLevel);
00116 RegisterAt(DisplayCtrl,"DisplayMaxLevel",base::_MaxLevel);
00117 RegisterAt(DisplayCtrl,"CutOut",base::_Eliminate);
00118 RegisterAt(DisplayCtrl,"CutOutValue",base::_EliminateValue);
00119 delete base::PlotLevel;
00120 base::PlotLevel = new int[NLevels()];
00121 for (int lev=0; lev<NLevels(); lev++) {
00122 char LevelName[16];
00123 std::sprintf(LevelName,"PlotGrid(%d)",lev);
00124 RegisterAt(DisplayCtrl,LevelName,base::PlotLevel[lev]);
00125 base::PlotLevel[lev] = 0;
00126 }
00127 int d;
00128 for (d=0; d<3; d++) {
00129 char VariableName[16];
00130 std::sprintf(VariableName,"ShowMin(%d)",d+1);
00131 RegisterAt(DisplayCtrl,VariableName,base::show[2*d]);
00132 std::sprintf(VariableName,"ShowMax(%d)",d+1);
00133 RegisterAt(DisplayCtrl,VariableName,base::show[2*d+1]);
00134 std::sprintf(VariableName,"ShowCut(%d)",d+1);
00135 RegisterAt(DisplayCtrl,VariableName,base::cut[d]);
00136 std::sprintf(VariableName,"Symmetry(%d)",d+1);
00137 RegisterAt(DisplayCtrl,VariableName,base::Symmetry[d]);
00138 std::sprintf(VariableName,"Periodic(%d)",d+1);
00139 RegisterAt(DisplayCtrl,VariableName,base::Periodic[d]);
00140 }
00141 RegisterAt(DisplayCtrl,"PlotCrossSection",_PlotCrossSection);
00142 for (d=0; d<3; d++) {
00143 char VariableName[16];
00144 std::sprintf(VariableName,"CrossPlaneP1(%d)",d);
00145 RegisterAt(DisplayCtrl,VariableName,CrossPlane[d]);
00146 }
00147 for (d=0; d<3; d++) {
00148 char VariableName[16];
00149 std::sprintf(VariableName,"CrossPlaneP2(%d)",d);
00150 RegisterAt(DisplayCtrl,VariableName,CrossPlane[3+d]);
00151 }
00152 for (d=0; d<3; d++) {
00153 char VariableName[16];
00154 std::sprintf(VariableName,"CrossPlaneP3(%d)",d);
00155 RegisterAt(DisplayCtrl,VariableName,CrossPlane[6+d]);
00156 }
00157
00158 ControlDevice WhereCtrl, ToCtrl, FromCtrl;
00159 for (register int l=0; l<MAXLEV; l++) {
00160 char devno[8];
00161 std::sprintf(devno,"(%d)",l);
00162 WhereCtrl = DisplayCtrl.getSubDevice("Where"+std::string(devno));
00163 for (int d=0; d<3; d++) {
00164 char text[8];
00165 std::sprintf(text,"lb(%d)",d+1);
00166 RegisterAt(WhereCtrl,text,base::_where[l].lower(d));
00167 std::sprintf(text,"ub(%d)",d+1);
00168 RegisterAt(WhereCtrl,text,base::_where[l].upper(d));
00169 std::sprintf(text,"s(%d)",d+1);
00170 RegisterAt(WhereCtrl,text,base::_where[l].stepsize(d));
00171 }
00172 ToCtrl = DisplayCtrl.getSubDevice("To"+std::string(devno));
00173 for (int d=0; d<3; d++) {
00174 char text[8];
00175 std::sprintf(text,"lb(%d)",d+1);
00176 RegisterAt(ToCtrl,text,base::_to[l].lower(d));
00177 std::sprintf(text,"ub(%d)",d+1);
00178 RegisterAt(ToCtrl,text,base::_to[l].upper(d));
00179 std::sprintf(text,"s(%d)",d+1);
00180 RegisterAt(ToCtrl,text,base::_to[l].stepsize(d));
00181 }
00182 FromCtrl = DisplayCtrl.getSubDevice("From"+std::string(devno));
00183 for (int d=0; d<3; d++) {
00184 char text[8];
00185 std::sprintf(text,"lb(%d)",d+1);
00186 RegisterAt(FromCtrl,text,base::_from[l].lower(d));
00187 std::sprintf(text,"ub(%d)",d+1);
00188 RegisterAt(FromCtrl,text,base::_from[l].upper(d));
00189 std::sprintf(text,"s(%d)",d+1);
00190 RegisterAt(FromCtrl,text,base::_from[l].stepsize(d));
00191 }
00192 }
00193 RegisterAt(DisplayCtrl,"RestrictData",base::RestrictData);
00194
00195 TheEvaluator().register_at(DisplayCtrl,"");
00196 DisplayCtrl.update();
00197
00198 TheEvaluator().update();
00199 }
00200
00201 virtual int SetUp(int step, std::string** filenames, int Nfilenames) {
00202 if (base::SetUp(step,filenames,Nfilenames) >= 0)
00203 for (typename block_list_type::iterator bit=BlockList().begin();
00204 bit!=BlockList().end(); bit++)
00205 (*bit)->SetCrossPlane(CrossPlane);
00206 return 0;
00207 }
00208
00209 virtual void SetGrid(float xyz[][3]) {
00210 SetGridNodes(xyz);
00211 }
00212
00213 virtual void SetScal(int *key,float v[]) {
00214 if (FKeys() == 1)
00215 SetScalNodes(key, v);
00216 else
00217 SetScalCells(key, v);
00218 if (TheEvaluator().mvals[2*(*key-1)] ==
00219 TheEvaluator().mvals[2*(*key-1)+1]) {
00220 if (TheEvaluator().mvals[2*(*key-1)] == 0.0) {
00221 TheEvaluator().mvals[2*(*key-1)] = -0.1;
00222 TheEvaluator().mvals[2*(*key-1)+1] = 0.1;
00223 }
00224 else {
00225 TheEvaluator().mvals[2*(*key-1)] -=
00226 0.1*TheEvaluator().mvals[2*(*key-1)];
00227 TheEvaluator().mvals[2*(*key-1)+1] +=
00228 0.1*TheEvaluator().mvals[2*(*key-1)+1];
00229 }
00230 }
00231
00232 int state;
00233 if (FKeys() == 1) state = 5;
00234 else state = 9;
00235 long int kk=(long int)(*key);
00236 V3_SETSTATE(&state, &kk, base::TheEvaluator().Mvals(*key-1),
00237 base::TheEvaluator().TitleKeys(*key-1),
00238 std::strlen(TheEvaluator().TitleKeys(*key-1)));
00239 }
00240
00241 virtual void Vect(int *key,float v[][3]) {
00242 if (FKeys() == 1)
00243 VectNodes(key, v);
00244 else
00245 VectCells(key, v);
00246 }
00247
00248 virtual void FindNodePairs() {
00249 register int i,j,k;
00250 int kn,knmatch,ijk[3];
00251 std::cerr << std::endl << "Finding matching node pairs";
00252 for (typename block_list_type::iterator bit=BlockList().begin();
00253 bit!=BlockList().end(); bit++){
00254
00255 BBox bbnodes(growupper((*bit)->DB().bbox(),1));
00256
00257 std::cerr << ".";
00258 for (typename block_list_type::iterator bitb=bit+1;
00259 bitb!=BlockList().end(); bitb++) {
00260
00261 BBox bbnodes_cur(growupper((*bitb)->DB().bbox(),1));
00262 BBox bbint = bbnodes * bbnodes_cur;
00263 if (bbint.empty())
00264 continue;
00265 bbint.lower() = (bbint.lower()/bbint.stepsize())*bbint.stepsize();
00266 bbint.upper() = (bbint.upper()/bbint.stepsize())*bbint.stepsize();
00267
00268
00269 if (bbint.lower(2) == bbnodes.lower(2)) {
00270 ijk[2]=bbint.lower(2);
00271 for(j=bbint.lower(1); j<=bbint.upper(1); j+=bbint.stepsize(1)) {
00272 ijk[1]=j;
00273 for(i=bbint.lower(0); i<=bbint.upper(0); i+=bbint.stepsize(0)) {
00274 ijk[0]=i;
00275 kn = (*bit)->FindMatchingNode(ijk);
00276 knmatch = (*bitb)->FindMatchingNode(ijk);
00277 if(kn<knmatch)
00278 if (NodePairs.empty() ||
00279 NodePairs.find(knmatch)==NodePairs.end())
00280 NodePairs.insert(node_pair_type(knmatch, kn));
00281 }
00282 }
00283 }
00284
00285
00286 if (bbint.upper(2) == bbnodes.upper(2)) {
00287 ijk[2]=bbint.upper(2);
00288 for(j=bbint.lower(1); j<=bbint.upper(1); j+=bbint.stepsize(1)) {
00289 ijk[1]=j;
00290 for(i=bbint.lower(0); i<=bbint.upper(0); i+=bbint.stepsize(0)) {
00291 ijk[0]=i;
00292 kn = (*bit)->FindMatchingNode(ijk);
00293 knmatch = (*bitb)->FindMatchingNode(ijk);
00294 if(kn<knmatch)
00295 if (NodePairs.empty() ||
00296 NodePairs.find(knmatch)==NodePairs.end())
00297 NodePairs.insert(node_pair_type(knmatch, kn));
00298 }
00299 }
00300 }
00301
00302
00303 if (bbint.lower(0) == bbnodes.lower(0)) {
00304 ijk[0]=bbint.lower(0);
00305 for(k=bbint.lower(2); k<=bbint.upper(2); k+=bbint.stepsize(2)) {
00306 ijk[2]=k;
00307 for(j=bbint.lower(1); j<=bbint.upper(1); j+=bbint.stepsize(1)) {
00308 ijk[1]=j;
00309 kn = (*bit)->FindMatchingNode(ijk);
00310 knmatch = (*bitb)->FindMatchingNode(ijk);
00311 if(kn<knmatch)
00312 if (NodePairs.empty() ||
00313 NodePairs.find(knmatch)==NodePairs.end())
00314 NodePairs.insert(node_pair_type(knmatch, kn));
00315 }
00316 }
00317 }
00318
00319
00320 if (bbint.upper(0) == bbnodes.upper(0)) {
00321 ijk[0]=bbint.upper(0);
00322 for(k=bbint.lower(2); k<=bbint.upper(2); k+=bbint.stepsize(2)) {
00323 ijk[2]=k;
00324 for(j=bbint.lower(1); j<=bbint.upper(1); j+=bbint.stepsize(1)) {
00325 ijk[1]=j;
00326 kn = (*bit)->FindMatchingNode(ijk);
00327 knmatch = (*bitb)->FindMatchingNode(ijk);
00328 if(kn<knmatch)
00329 if (NodePairs.empty() ||
00330 NodePairs.find(knmatch)==NodePairs.end())
00331 NodePairs.insert(node_pair_type(knmatch, kn));
00332 }
00333 }
00334 }
00335
00336
00337 if (bbint.lower(1) == bbnodes.lower(1)) {
00338 ijk[1]=bbint.lower(1);
00339 for(k=bbint.lower(2); k<=bbint.upper(2); k+=bbint.stepsize(2)) {
00340 ijk[2]=k;
00341 for(i=bbint.lower(0); i<=bbint.upper(0); i+=bbint.stepsize(0)) {
00342 ijk[0]=i;
00343 kn = (*bit)->FindMatchingNode(ijk);
00344 knmatch = (*bitb)->FindMatchingNode(ijk);
00345 if(kn<knmatch)
00346 if (NodePairs.empty() ||
00347 NodePairs.find(knmatch)==NodePairs.end())
00348 NodePairs.insert(node_pair_type(knmatch, kn));
00349 }
00350 }
00351 }
00352
00353
00354 if (bbint.upper(1) == bbnodes.upper(1)) {
00355 ijk[1]=bbint.upper(1);
00356 for(k=bbint.lower(2); k<=bbint.upper(2); k+=bbint.stepsize(2)) {
00357 ijk[2]=k;
00358 for(i=bbint.lower(0); i<=bbint.upper(0); i+=bbint.stepsize(0)) {
00359 ijk[0]=i;
00360 kn = (*bit)->FindMatchingNode(ijk);
00361 knmatch = (*bitb)->FindMatchingNode(ijk);
00362 if(kn<knmatch)
00363 if (NodePairs.empty() ||
00364 NodePairs.find(knmatch)==NodePairs.end())
00365 NodePairs.insert(node_pair_type(knmatch, kn));
00366 }
00367 }
00368 }
00369 }
00370 }
00371 std::cerr << std::endl;
00372 }
00373
00374 virtual void SetNodePairs(int listequiv[][2]){
00375 int i = 0;
00376 for (node_pair_list_type::iterator npit=NodePairs.begin();
00377 npit!=NodePairs.end(); npit++, i++) {
00378 listequiv[i][0]=(*npit).second;
00379 listequiv[i][1]=(*npit).first;
00380 }
00381 NodePairs.clear();
00382 }
00383
00384 virtual int NFacetsOnSurface() {
00385 int dummy[1][4];
00386 int ksurf=0;
00387 for (int kn=0; kn<6; kn++) {
00388 int d=kn/2;
00389 BBoxList surflist;
00390 typename block_list_type::iterator bit;
00391 for (bit=BlockList().begin();bit!=BlockList().end(); bit++) {
00392 BBox bbnodes(growupper((*bit)->DB().bbox(),1));
00393 if (kn%2) bbnodes.upper(d) = bbnodes.lower(d);
00394 else bbnodes.lower(d) = bbnodes.upper(d);
00395 surflist.add(bbnodes);
00396 }
00397 for (bit=BlockList().begin();bit!=BlockList().end(); bit++)
00398 (*bit)->SetSurfaces(kn, surflist, ksurf, dummy, 0);
00399 }
00400 return ksurf;
00401 }
00402
00403 virtual void SetSurfaces(int nsurf[][2], int surf[], int scel[][4],
00404 char tsurf[][20]) {
00405 int ksurf = 0;
00406 for (int kn=0; kn<6; kn++) {
00407 int d=kn/2;
00408 BBoxList surflist;
00409 typename block_list_type::iterator bit;
00410 for (bit=BlockList().begin();bit!=BlockList().end(); bit++) {
00411 BBox bbnodes(growupper((*bit)->DB().bbox(),1));
00412 if (kn%2) bbnodes.upper(d) = bbnodes.lower(d);
00413 else bbnodes.lower(d) = bbnodes.upper(d);
00414 surflist.add(bbnodes);
00415 }
00416 for (bit=BlockList().begin();bit!=BlockList().end(); bit++)
00417 (*bit)->SetSurfaces(kn, surflist, ksurf, scel, 1);
00418 nsurf[kn][0] = ksurf;
00419 nsurf[kn][1] = SurfaceDisp[kn];
00420 }
00421 strcpb(tsurf[0],"West",20);
00422 strcpb(tsurf[1],"East",20);
00423 strcpb(tsurf[2],"Bottom",20);
00424 strcpb(tsurf[3],"Top",20);
00425 strcpb(tsurf[4],"Front",20);
00426 strcpb(tsurf[5],"Back",20);
00427
00428 std::cerr << "Actual ksurf: " << ksurf << std::endl;
00429 }
00430
00431 virtual void Draw3D() {
00432 DrawFrameAroundGrid();
00433 Draw3DGrids();
00434 Draw3dCrossSections();
00435
00436
00437 }
00438
00439 void Draw3DGrids() {
00440 for (typename block_list_type::iterator bit=BlockList().begin();
00441 bit!=BlockList().end(); bit++)
00442 if (base::PlotLevel[(*bit)->Level()] > 0)
00443 (*bit)->Draw3DGrids();
00444 }
00445
00446 void Draw3dCrossSections() {
00447 if(_PlotCrossSection>0){
00448 for (typename block_list_type::iterator bit=BlockList().begin();
00449 bit!=BlockList().end(); bit++)
00450 if (base::PlotLevel[(*bit)->Level()] != 0)
00451 (*bit)->Draw3DCrossSections();
00452 }
00453 }
00454
00455 void DrawOrigin() {
00456 int itype = 3;
00457 int icolor = 1;
00458 int np = 1*2;
00459 float radii = 0.;
00460 int intzero = 0;
00461 float linesx[2*3] = { 5., 0., 0., 0., 0., 0.};
00462 GeomMapField(linesx, 2*3);
00463 float colorx[2] = { 0., 0.,};
00464 V3_OBJECT3D(&itype, &icolor, linesx, &radii, colorx, &intzero, &np);
00465
00466 float linesy[2*3] = { 0., 5., 0., 0., 0., 0.};
00467 GeomMapField(linesy, 2*3);
00468 float colory[2] = {0.5, 0.5};
00469 V3_OBJECT3D(&itype, &icolor, linesy, &radii, colory, &intzero, &np);
00470
00471 float linesz[2*3] = { 0., 0., 5., 0., 0., 0.};
00472 GeomMapField(linesz, 2*3);
00473 float colorz[2] = { 1., 1.};
00474 V3_OBJECT3D(&itype, &icolor, linesz, &radii, colorz, &intzero, &np);
00475
00476 float floatzero = 0.;
00477 itype = 1;
00478 np = 2*3;
00479 float trianglesx[2*3*3] = { 6., 0., 0., 5., .5, 0., 5.,-.5, 0.,
00480 6., 0., 0., 5., 0., .5, 5., 0.,-.5};
00481 GeomMapField(trianglesx, 2*3*3);
00482 float tricolorx[2*3] = { 0., 0., 0., 0., 0., 0.};
00483 V3_OBJECT3D(&itype, &icolor, trianglesx, &radii, tricolorx, &intzero, &np);
00484
00485 float trianglesy[2*3*3] = { 0., 6., 0., .5, 5., 0.,-.5, 5., 0.,
00486 0., 6., 0., 0., 5., .5, 0., 5.,-.5};
00487 GeomMapField(trianglesy, 2*3*3);
00488 float tricolory[2*3] = { 0.5, 0.5, 0.5, 0.5, 0.5, 0.5};
00489 V3_OBJECT3D(&itype, &icolor, trianglesy, &radii, tricolory, &intzero, &np);
00490
00491 float trianglesz[2*3*3] = { 0., 0., 6., 0., .5, 5., 0.,-.5, 5.,
00492 0., 0., 6., .5, 0., 5.,-.5, 0., 5.};
00493 GeomMapField(trianglesz, 2*3*3);
00494 float tricolorz[2*3] = { 1., 1., 1., 1., 1., 1.};
00495 V3_OBJECT3D(&itype, &icolor, trianglesz, &radii, tricolorz, &intzero, &np);
00496
00497 icolor = 0;
00498 itype = 5;
00499 np = 1;
00500 float midpoint[1*3] = { 0., 0., 0.};
00501 radii = .5*base::dx[0];
00502 V3_OBJECT3D(&itype, &icolor, midpoint, &radii, &floatzero, &intzero, &np);
00503 }
00504
00505 void DrawXYZ(){
00506 int itype = 0;
00507 int icolor = 1;
00508 int np = 2*4;
00509 float radii = 0.;
00510 int intzero = 0;
00511 float slashx[2*4*3] = { 6,-1,-1,6.5,-1,-1,8,-4,-1,7.5,-4,-1,
00512 7.5,-1,-1,8,-1,-1,6.5,-4,-1,6,-4,-1};
00513 GeomMapField(slashx, 2*4*3);
00514 float colorx[2*4] = { 0,0,0,0,0,0,0,0};
00515 V3_OBJECT3D(&itype, &icolor, slashx, &radii, colorx, &intzero, &np);
00516
00517 float slashy[2*4*3] = { -1.5,8,-1,-1,8,-1,-2.5,5,-1,-3,5,-1,
00518 -3,8,-1,-2.5,8,-1,-2,6.5,-1,-2.42,6,-1};
00519
00520 GeomMapField(slashy, 2*4*3);
00521 float colory[2*4] = { 0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5};
00522 V3_OBJECT3D(&itype, &icolor, slashy, &radii, colory, &intzero, &np);
00523
00524 np=3*4;
00525 float slashz[3*4*3] = { -3,-1,7,-1,-1,7,-1,-1.5,7,-3,-1.5,7,
00526 -1.5,-1,7,-1,-1,7,-2.5,-4,7,-3,-4,7,
00527 -3,-3.5,7,-1,-3.5,7,-1,-4,7,-3,-4,7};
00528
00529 GeomMapField(slashz, 3*4*3);
00530 float colorz[3*4] = {1,1,1,1,1,1,1,1,1,1,1,1};
00531 V3_OBJECT3D(&itype, &icolor, slashz, &radii, colorz, &intzero, &np);
00532 }
00533
00534 void DrawFrameAroundGrid() {
00535 float radii = 0.;
00536 float floatzero = 0.;
00537 int intzero = 0;
00538 int itype = 4;
00539 int icolor = 0;
00540 int np = 5;
00541 float line1[5*3] = { base::geom[0], base::geom[2], base::geom[4],
00542 base::geom[0], base::geom[3], base::geom[4],
00543 base::geom[1], base::geom[3], base::geom[4],
00544 base::geom[1], base::geom[2], base::geom[4],
00545 base::geom[0], base::geom[2], base::geom[4] };
00546 V3_OBJECT3D(&itype, &icolor, line1, &radii, &floatzero, &intzero, &np);
00547
00548 float line2[5*3] = { base::geom[0], base::geom[2], base::geom[5],
00549 base::geom[0], base::geom[3], base::geom[5],
00550 base::geom[1], base::geom[3], base::geom[5],
00551 base::geom[1], base::geom[2], base::geom[5],
00552 base::geom[0], base::geom[2], base::geom[5] };
00553 V3_OBJECT3D(&itype, &icolor, line2, &radii, &floatzero, &intzero, &np);
00554
00555 itype = 3;
00556 np = 2*4;
00557 float lines[2*4*3] = { base::geom[0], base::geom[2], base::geom[4],
00558 base::geom[0], base::geom[2], base::geom[5],
00559 base::geom[0], base::geom[3], base::geom[4],
00560 base::geom[0], base::geom[3], base::geom[5],
00561 base::geom[1], base::geom[2], base::geom[4],
00562 base::geom[1], base::geom[2], base::geom[5],
00563 base::geom[1], base::geom[3], base::geom[4],
00564 base::geom[1], base::geom[3], base::geom[5]};
00565 V3_OBJECT3D(&itype, &icolor, lines, &radii, &floatzero, &intzero, &np);
00566 }
00567
00568 virtual const int& Equiv() const { return _Equiv; }
00569 virtual int Kequiv() const { return NodePairs.size(); }
00570
00571 virtual void BlockListAppend(hdata_block_type& workdata, BBox& bb, int comp, int& Level,
00572 int& proc, float* dx, float* geom) {
00573 BlockList().push_back(new data_block_type(*this, workdata, bb, comp,
00574 TheEvaluator(), Level, proc, dx, geom));
00575 }
00576
00577 block_list_type& BlockList() { return (block_list_type &)*base::_BlockList; }
00578 block_list_type& BlockList() const { return (block_list_type &)*base::_BlockList; }
00579
00580 virtual void register_at(ControlDevice& Ctrl,const std::string& prefix) {
00581 base::register_at(Ctrl,prefix); }
00582 virtual void register_at(ControlDevice& Ctrl) {
00583 register_at(Ctrl, ""); }
00584 virtual int NCells() { return base::NCells(); }
00585 virtual int NNodes() { return base::NNodes(); }
00586 virtual void SetBlocks(int blocks[]) { base::SetBlocks(blocks); }
00587 virtual void SetGridCells(float xyz[][3]) {
00588 base::SetGridCells(xyz); }
00589 virtual void SetGridNodes(float xyz[][3]) {
00590 base::SetGridNodes(xyz); }
00591 virtual void SetGridConns(int con[][8]) {
00592 base::SetGridConns(con); }
00593 virtual void SetScalCells(int *key,float v[]) {
00594 base::SetScalCells(key,v); }
00595 virtual void SetScalNodes(int *key,float v[]) {
00596 base::SetScalNodes(key,v); }
00597 virtual void VectNodes(int *key,float v[][3]) {
00598 base::VectNodes(key,v); }
00599 virtual void VectCells(int *key,float v[][3]) {
00600 base::VectCells(key,v); }
00601 virtual int Size() const { return base::Size(); }
00602 virtual const int& MinLevel() const { return base::MinLevel(); }
00603 virtual const int& MaxLevel() const { return base::MaxLevel(); }
00604 virtual const int& NLevels() const { return base::NLevels(); }
00605 virtual const int& RefineFactor(const int l) const {
00606 return base::RefineFactor(l); }
00607 virtual const BBox& GlobalBBox() const {
00608 return base::GlobalBBox(); }
00609 virtual const int& FKeys() const { return base::FKeys(); }
00610 virtual evaluator_type& TheEvaluator() const {
00611 return base::TheEvaluator(); }
00612 virtual evaluator_type& TheEvaluator() {
00613 return base::TheEvaluator(); }
00614 virtual float64 RealTime() const { return base::RealTime(); }
00615 virtual void SetUpdateName(std::string* iname) {
00616 base::SetUpdateName(iname); }
00617 virtual std::string* UpdateName() { return base::UpdateName(); }
00618 virtual std::string* UpdateName() const {
00619 return base::UpdateName(); }
00620
00621 private:
00622 void GeomMapField(float field[], int size) {
00623 for (int i=0; i<size; i+=3) {
00624 field[i] *= base::dx[0]; field[i+1] *= base::dx[1]; field[i+2] *= base::dx[2];
00625 field[i] += base::geom[0]; field[i+1] += base::geom[2]; field[i+2] += base::geom[4];
00626 }
00627 }
00628
00629 private:
00630 int _Equiv;
00631 node_pair_list_type NodePairs;
00632 int SurfaceDisp[NSURF];
00633 float CrossPlane[9];
00634 int _PlotCrossSection;
00635 };
00636
00637 #endif