DATAKIT API  V2025.3
testlibugwrite.cpp File Reference

Macros

#define NX_RETRIEVE_ASSEMBLYDATA   NULL
 

Functions

Dtk_LayerInfosSetPtr CreateLayerInfosSet (Dtk_tab< Dtk_Int32 > &visible, Dtk_tab< Dtk_Int32 > &selectable)
 
Dtk_AxisSystemPtr MakeAxisSystem ()
 
Dtk_BodyPtr MakeFixedRefPlane ()
 
Dtk_InfoPtr MakeInstanceData (const Dtk_string &instancename, const Dtk_RGB &col, bool visible, int layer)
 
Dtk_MetaDataPtr MakeMetaData (const Dtk_string &propname, const Dtk_string &value, const Dtk_string &category="")
 
Dtk_BodyPtr MakeRefAxis ()
 
Dtk_BodyPtr MakeRefPlane ()
 
Dtk_BodyPtr MakeRefPoint ()
 
Dtk_FdtPtr UGW_Sample_MakePMI ()
 
Dtk_ErrorStatus UgwAnnot (const Dtk_string &outputFileName, int version)
 
Dtk_ErrorStatus UgwAsm (const Dtk_string &outputFileName, int version)
 
Dtk_ErrorStatus UgwColors (const Dtk_string &outputFileName, int version)
 
Dtk_ErrorStatus UgwExternAsm (const Dtk_string &outputFileName, int version)
 
Dtk_ErrorStatus UgwExternJTMesh (const Dtk_string &outputFileName, const Dtk_string &jtfic, int version)
 
Dtk_ErrorStatus UgwExternParasolid (const Dtk_string &outputFileName, const Dtk_string &parasolidfic, int version)
 
Dtk_ErrorStatus UgwGroups (const Dtk_string &outputFileName, int version)
 
Dtk_ErrorStatus UgwLayers (const Dtk_string &outputFileName, int version)
 
Dtk_ErrorStatus UgwMesh (const Dtk_string &outputFileName, int version)
 
Dtk_ErrorStatus UgwMeta (const Dtk_string &outputFileName, int version)
 
Dtk_ErrorStatus UgwReferences (const Dtk_string &outputFileName, int version)
 
Dtk_ErrorStatus UgwRefSets (const Dtk_string &outputFileName, int version)
 
int UgWriteSample (const Dtk_string &inResultDirectory)
 
Dtk_ErrorStatus UgWriteSampleVersion (const Dtk_string &outputDirectory, int version)
 
Dtk_ErrorStatus UgwSimpleBody (const Dtk_string &outputFileName, int version)
 
Dtk_ErrorStatus UgwTwoBodies (const Dtk_string &outputFileName, int version)
 
Dtk_ErrorStatus UgwWire (const Dtk_string &outputFileName, int version)
 

Macro Definition Documentation

◆ NX_RETRIEVE_ASSEMBLYDATA

#define NX_RETRIEVE_ASSEMBLYDATA   NULL

Function Documentation

◆ CreateLayerInfosSet()

Dtk_LayerInfosSetPtr CreateLayerInfosSet ( Dtk_tab< Dtk_Int32 > &  visible,
Dtk_tab< Dtk_Int32 > &  selectable 
)
277 {
278  const int maxlayer = 257; // 256 layers (from 1 to 256 included for NX)
280  visible.resize(maxlayer, 1);
281  selectable.resize(maxlayer, 1);
282  // visibles and selectables
283  int i;
284  for (i = 1; i < maxlayer; i++)
285  {
286  visible[i] = (i % 2); // one on two
287  selectable[i] = ((i % 3) != 0); // one on three
288  }
289  // 2 layer filters :
290  Dtk_LayerFilterInfosPtr filter456 = lay->CreateLayerFilterInfos("FILTER_456", "MyDescription");
291  Dtk_tab<Dtk_Size_t> lay456;
292  lay456.push_back(4); lay456.push_back(5); lay456.push_back(6);
293  filter456->SelectLayers(lay456);
294 
295  Dtk_LayerFilterInfosPtr filter678 = lay->CreateLayerFilterInfos("FILTER_678");
296  Dtk_tab<Dtk_Size_t> lay678;
297  lay678.push_back(6); lay678.push_back(7); lay678.push_back(8);
298  filter678->SelectLayers(lay678);
299  // wrok layer (default)
300  lay->SetDefaultLayer(12);
301 
302  return lay;
303 }

◆ MakeAxisSystem()

Dtk_AxisSystemPtr MakeAxisSystem ( )
106 {
107  Dtk_transfo t;
108  t.addTranslate(Dtk_dir(-100, 50, 200));
110  axis->SetName("MyAxisSystem");
111  axis->info()->AddAttribute("NXNAME", Dtk_Val("ANOTHERAXISSYSTEM"));
112  axis->info()->SetColor(255, 255, 0);
113  axis->SetMatrix(t);
114  return axis;
115 }

◆ MakeFixedRefPlane()

Dtk_BodyPtr MakeFixedRefPlane ( )
134 {
135  Dtk_BodyPtr body = Dtk_Body::Create();
136  body->info() = Dtk_Info::create();
137  body->info()->SetName("MyFixedRefPlane");
138  body->info()->AddAttribute("NXNAME", Dtk_Val("ANOTHERFIXEDPLANENAME"));
139  body->info()->SetColor(0, 0, 255);
140  Dtk_ShellPtr shell = Dtk_Shell::Create(body);
141  body->AddOpenShell(shell);
142  Dtk_FacePtr face = Dtk_Face::Create(body);
143  Dtk_PlaneSurfacePtr plane = Dtk_PlaneSurface::Create(Dtk_pnt(250, 250, 0), Dtk_dir(0, 0, 1), Dtk_dir(1, 0, 0));
144  double trim[] = { -10,10,-10,10 };
145  plane->SetTrimUVBox(trim);
147  shell->AddFace(face, DTK_TRUE);
148  return body;
149 }

◆ MakeInstanceData()

Dtk_InfoPtr MakeInstanceData ( const Dtk_string instancename,
const Dtk_RGB col,
bool  visible,
int  layer 
)
493 {
494  Dtk_InfoPtr infos = Dtk_Info::create();
495  infos->SetName(instancename);
496  infos->SetColor(col);
497  if (!visible)
498  infos->SetBlankedStatus(1);
499  if (layer != -1)
500  infos->SetLayer(layer);
501  return infos;
502 }

◆ MakeMetaData()

Dtk_MetaDataPtr MakeMetaData ( const Dtk_string propname,
const Dtk_string value,
const Dtk_string category = "" 
)
428 {
430  meta->SetCategory(category);
431  return meta;
432 }

◆ MakeRefAxis()

Dtk_BodyPtr MakeRefAxis ( )
152 {
153  Dtk_BodyPtr body = Dtk_Body::Create();
154  body->info() = Dtk_Info::create();
155  body->info()->SetName("MyRefAxis");
156  body->info()->AddAttribute("NXNAME", Dtk_Val("ANOTHERAXISNAME"));
157  body->info()->SetColor(0, 255, 0);
158  Dtk_ShellPtr shell = Dtk_Shell::Create(body);
159  body->AddOpenShell(shell);
161  Dtk_LinePtr line = Dtk_Line::Create(Dtk_pnt(160, 100, 10), Dtk_pnt(260, 200, 30));
163  shell->AddWire(tab);
164  return body;
165 }

◆ MakeRefPlane()

Dtk_BodyPtr MakeRefPlane ( )
118 {
119  Dtk_BodyPtr body = Dtk_Body::Create();
120  body->info() = Dtk_Info::create();
121  body->info()->SetName("MyReferencePlane");
122  body->info()->AddAttribute("NXNAME", Dtk_Val("MYPLANE"));
123  body->info()->SetColor(0, 255, 255);
124  Dtk_ShellPtr shell = Dtk_Shell::Create(body);
125  body->AddOpenShell(shell);
126  Dtk_FacePtr face = Dtk_Face::Create(body);
127  Dtk_PlaneSurfacePtr plane = Dtk_PlaneSurface::Create(Dtk_pnt(150, 150, 0), Dtk_dir(0, 0, 1), Dtk_dir(1, 0, 0));
129  shell->AddFace(face, DTK_TRUE);
130  return body;
131 }

◆ MakeRefPoint()

Dtk_BodyPtr MakeRefPoint ( )
168 {
169  Dtk_BodyPtr body = Dtk_Body::Create();
170  body->info() = Dtk_Info::create();
171  body->info()->SetName("MyRefPoint");
172  body->info()->SetColor(255, 100, 0);
173  Dtk_ShellPtr shell = Dtk_Shell::Create(body);
174  body->AddOpenShell(shell);
176  Dtk_PointPtr point = Dtk_Point::Create(Dtk_pnt(0, 310, 10));
177  tab.push_back(point);
178  shell->AddWire(tab);
179  return body;
180 }

◆ UGW_Sample_MakePMI()

Dtk_FdtPtr UGW_Sample_MakePMI ( )
604 {
606  // text informations
607  Dtk_TextStyle textstyle;
608  Dtk_InfoPtr textinfos = Dtk_Info::create();
609  // All datas below match NX menu Note Settings/ lettering
610  textinfos->AddAttribute("NX_AlignmentPosition", 4); // optional (1=TL,2=TC,3=TR,4=ML(def),5=MC,6=MR,7=BL,8=BC,9=BR)
611  textstyle.Justification() = Dtk_TextStyle::JustificationLeft; // Text Justification
612  textinfos->SetCurveThickNessInMM(0.1); // optional, assume <0.5 = thin, >1.0 = thick else normal
613  textstyle.CharHeight() = 11; // mandatory height
614  textinfos->AddAttribute("NX_FontGapFactor", 0.0); // optional (def 0.0)
615  textstyle.Ratio() = 1.0; // optional Text Aspect Ratio
616  textinfos->AddAttribute("NX_LineGapFactor", 1.0);// optional (def 1.0)
617  textinfos->AddAttribute("NX_LetteringAngle", 0.0);// optional (def 0.0)
618  textinfos->AddAttribute("NX_HeightFactor", 2.0); // optional (def 2.0)
619  textinfos->SetColor(Dtk_RGB(255, 0, 0)); // optional, a red text
620  //textstyle.Font().Name() = "Arial"; // optional, defaut blockfont (strokefont).
621  // NX5 supports only "blockfont", "Arial" and "NX ANSI Symbols"
622  // NX1980, append font name in table
623 
624  Dtk_pnt textorigin2D = Dtk_pnt(100, 20, 0); // all location are defined a 2D Coordinate system where Z = 0.
625  Dtk_Oriented2dBBox textbbox(textorigin2D, -1, -1); // -1 for width if unknown, height is given by textstyle.CharHeight()
626 
627  Dtk_Text text("SampleText\nsub1\nsub2", textbbox, textbbox, DTK_PI / 2.0, 0, dtk_text_type_value, textinfos, textstyle);
628  Dtk_CompositeText compotext;
629  compotext.AddText(text);
630  symb->Texts() = compotext;
631 
632  // arrow, see menu in NX : Note Settings / ArrowHead
633  Dtk_pnt arrowlocation = Dtk_pnt(50, 0, 0); // all location are defined a 2D Coordinate system where Z = 0.
634  double arrowlength = 5.5; // length of arrow througt line
636  Dtk_LeaderPtr leader = Dtk_Leader::Create(arrowlength, 0.0, arrowlocation, arrowtype, Dtk_tab<Dtk_pnt>());
637  // Note Settings / ArrowLine
638  leader->GetInfo()->SetColor(Dtk_RGB(0, 0, 255)); // optional, a blue leader
639  leader->GetInfo()->SetCurveThickNessInMM(0.7); // optional, assume <0.5 = thin, >1.0 = thick else normal
640  leader->GetInfo()->SetCurveLineType(DTK_PHANTOM); // optional, see enum enum Dtk_FontLineType
641  leader->GetInfo()->AddAttribute("NX_TextToLineGap", 10.0);// optional (def = 10.0)
642  leader->GetInfo()->AddAttribute("NX_TextOverStubFactor", 0.1);// optional (def = 0.1)
643 // Note Settings
644  leader->GetInfo()->AddAttribute("NX_StubLength", 20.0); // optional (def = 20.0)
645  leader->GetInfo()->AddAttribute("NX_StubSide", 1); // optional 1 for left (default), 0 for right
646  leader->GetInfo()->AddAttribute("NX_TextAlignment", 1); // optional 1 for top (default), 2 for middle, 3 for bottom
647 // Note Settings / ArrowHead
648  leader->GetArrowHead().GetInfo()->AddAttribute("NX_ArrowAngle", 30.0); // optional length given above (def = 30)
649  leader->GetArrowHead().GetInfo()->AddAttribute("NX_DotDiameter", 1.5); // optional (def = 1.5)
650  leader->GetArrowHead().GetInfo()->SetColor(Dtk_RGB(255, 0, 255)); // optional, a purple arrow
651  leader->GetArrowHead().GetInfo()->SetCurveThickNessInMM(2.0); // optional, assume <0.5 = thin, >1.0 = thick else normal
652  leader->GetArrowHead().GetInfo()->SetCurveLineType(DTK_SOLIDLINE); // optional, see enum enum Dtk_FontLineType
653 
654  symb->AddLeader(leader);
655 
656  // Final Placement :
657  Dtk_dir X(0, 0, 1);
658  Dtk_dir Y(-1, 0, 0);
659  Dtk_pnt O(0, 0, 0);
660 
661  Dtk_transfo trans = Dtk_transfo(X, Y, X^Y, O);
662 
664  pmi->info() = Dtk_Info::create();
665  pmi->info()->SetName("MyAnnot");
666  return pmi;
667 }

◆ UgwAnnot()

Dtk_ErrorStatus UgwAnnot ( const Dtk_string outputFileName,
int  version 
)
670 {
671  // Cube Sample
673  // First we initialize writing with name of output file (see macro CHECK_OK above)
674  CHECK_OK(Ugw::InitFile(outputFileName, version));
675 
676  // Then we write the 2 bodies constructed
677  CHECK_OK(Ugw::WriteBody(cube));
678 
680  CHECK_OK(Ugw::WritePMI(pmi));
681 
682  // Write final file and release the writer.
684  std::cout << "=> " << outputFileName.c_str() << endl;
685 
686  return dtkNoError;
687 }

◆ UgwAsm()

Dtk_ErrorStatus UgwAsm ( const Dtk_string outputFileName,
int  version 
)
505 {
506  Dtk_BodyPtr CubeBody = sampleWriter::CreateCube(); // get a brepcube (common sample)
507  Dtk_MeshPtr CubeMesh = sampleWriter::CreateMeshCylinder(8); // get a meshcube (common sample)
508  Dtk_BodyPtr WireBody = sampleWriter::CreateCurves(); // get wire curve into a body.
509  CubeMesh->Transform(Dtk_transfo(Dtk_dir(30, 0, 0), Dtk_dir(0, 30, 0), Dtk_dir(0, 0, 30), Dtk_pnt())); // rescale mesh too small
510  Dtk_transfo cubetransfo; // identity
511 
512  CHECK_OK(Ugw::InitFile(outputFileName, version)); // create root prt file
513 
514  CHECK_OK(Ugw::OpenInstance("sub1", cubetransfo, MakeInstanceData("SubAssembly", Dtk_RGB(), true, -1))); // sub1 subassembly
515 
516  CHECK_OK(Ugw::WriteBody(CubeBody)); // put a cube on the subassembly
517 
518  cubetransfo.addTranslate(Dtk_dir(350, 0, 0)); // shift matrix.
519  CHECK_OK(Ugw::OpenInstance("leaf1", cubetransfo, MakeInstanceData("RedCube_SpecificLayer12", Dtk_RGB(255, 0, 0), true, 12)));
520  CHECK_OK(Ugw::WriteBody(CubeBody));
522 
523  cubetransfo.addTranslate(Dtk_dir(150, 0, 0)); // shift matrix.
524  CHECK_OK(Ugw::OpenInstance("leaf2", cubetransfo, MakeInstanceData("GreenCube_Transparent", Dtk_RGB(0, 255, 0, 128), true, -1)));
525  CHECK_OK(Ugw::WriteBody(CubeBody));
527 
528  // create a second instance of "leaf2.prt", reusing "leaf2.prt" automatic retrieve instance
529  cubetransfo.addTranslate(Dtk_dir(150, 0, 0)); // shift matrix.
530  CHECK_OK(Ugw::OpenInstance("leaf2", cubetransfo, MakeInstanceData("ReinstanciedBlueCube", Dtk_RGB(0, 0, 255), true, -1)));
531  CHECK_OK(Ugw::CloseLastInstance()); // for reinstance, close immediatly
532 
533  cubetransfo.addTranslate(Dtk_dir(150, 0, 0)); // shift matrix again
534  CHECK_OK(Ugw::OpenInstance("leaf3", cubetransfo, MakeInstanceData("TealCube_Invisible", Dtk_RGB(0, 255, 255), false, -1)));
535  CHECK_OK(Ugw::WriteBody(CubeBody));
536  CHECK_OK(Ugw::CloseLastInstance()); // for reinstance, close immediatly
537 
538  cubetransfo.addTranslate(Dtk_dir(150, 0, 0)); // shift matrix.
539  CHECK_OK(Ugw::OpenInstance("leaf4", cubetransfo, MakeInstanceData("MeshCyl", Dtk_RGB(), true, -1)));
540  CHECK_OK(Ugw::WriteMesh(CubeMesh));
542 
543  cubetransfo.addTranslate(Dtk_dir(150, 0, 0)); // shift matrix.
544  CHECK_OK(Ugw::OpenInstance("leaf5", cubetransfo, MakeInstanceData("Wire", Dtk_RGB(), true, -1)));
545  CHECK_OK(Ugw::WriteBody(WireBody));
547 
549 
550  CHECK_OK(Ugw::EndFile()); // close root prt file
551  std::cout << "=> " << outputFileName.c_str() << endl;
552  return dtkNoError;
553 }

◆ UgwColors()

Dtk_ErrorStatus UgwColors ( const Dtk_string outputFileName,
int  version 
)
468 {
470  CHECK_OK(Ugw::InitFile(outputFileName, version));
471 
472  for (int i = 0; i < 217; i++)
473  {
474  Dtk_string name = "Datakit_";
475  name.add_int(i);
476  Dtk_RGB rgb = Dtk_RGB(i + 30, 0, 0);
477  CHECK_OK(Ugw::SetColorInTable(i, rgb, name));
478  }
479 
480  CHECK_OK(Ugw::WriteBody(CubeBody));
482  std::cout << "=> " << outputFileName.c_str() << endl;
483 
484  return dtkNoError;
485 }

◆ UgwExternAsm()

Dtk_ErrorStatus UgwExternAsm ( const Dtk_string outputFileName,
int  version 
)
570 {
571  // This example create an assembly from extern prt files
572  // First we initialize writing with name of output file (see macro CHECK_OK above)
573  CHECK_OK(Ugw::InitFile(outputFileName, version));
574 
575  // We add extern twobodies (.prt) written by this sample previously
576  // The last parameter is a pointer on a function from datakit NXreader to retrieve subassembly datas : (instance names, colors, layer, visbility).
577  // This is optional, if NULL is given, the current file doesn't know these datas from subassemblies.
579 
580  Dtk_transfo trans;
581  trans.addTranslate(Dtk_dir(0, 0, 200));
582  // We add extern asm (.prt) written by this sample previously
583  // We transmit function nxreader_GetData from NXReader, to retrieve cube colors set in subassembly sub1.prt
584  CHECK_OK(Ugw::AddExternInstance("asm", trans, MakeInstanceData("FirstInstance", Dtk_RGB(), true, 5), NX_RETRIEVE_ASSEMBLYDATA));
585 
586  trans.addTranslate(Dtk_dir(0, 200, 0));
587  // We add a second time extern asm (.prt) written by this sample previously
588  CHECK_OK(Ugw::AddExternInstance("asm", trans, MakeInstanceData("SecondInstance", Dtk_RGB(), true, 15), NX_RETRIEVE_ASSEMBLYDATA));
589 
590  // Write final file and release the writer.
592  std::cout << "=> " << outputFileName.c_str() << endl;
593 
594  return dtkNoError;
595 }

◆ UgwExternJTMesh()

Dtk_ErrorStatus UgwExternJTMesh ( const Dtk_string outputFileName,
const Dtk_string jtfic,
int  version 
)
243 {
244  FILE* F = jtfic.OpenFile(DTK_RB);
245  if (!F)
246  {
247  std::cout << "error : " << jtfic.c_str() << " does not exist" << endl;
248  return dtkErrorFileNotExist;
249  }
250  Dtk_tab<char> flux;
251  fseek(F, 0, SEEK_END);
252  flux.resize(ftell(F));
253  fseek(F, 0, SEEK_SET);
254  if (flux.size() > 0)
255  fread(&flux[0], 1, flux.size(), F);
256  fclose(F);
257 
259  inf->SetName("MyFeatureName");
260  inf->AddAttribute("NXNAME", Dtk_string("SolidName"));
261  //inf->SetBlankedStatus(1); // set as invisible
262  //inf->SetColor(Dtk_RGB(255, 0, 0)); // set a body color (appear on non colored faces)
263 
264  CHECK_OK(Ugw::InitFile(outputFileName, version));
265  CHECK_OK(Ugw::WriteExternJtMesh(&flux[0], flux.size(), inf));
267  std::cout << "=> " << outputFileName.c_str() << endl;
268  return dtkNoError;
269 }

◆ UgwExternParasolid()

Dtk_ErrorStatus UgwExternParasolid ( const Dtk_string outputFileName,
const Dtk_string parasolidfic,
int  version 
)
209 {
210  FILE* F = parasolidfic.OpenFile(DTK_RB);
211  if (!F)
212  {
213  std::cout << "error : " << parasolidfic.c_str() << " does not exist" << endl;
214  return dtkErrorFileNotExist;
215  }
216  Dtk_tab<char> flux;
217  fseek(F, 0, SEEK_END);
218  flux.resize(ftell(F));
219  fseek(F, 0, SEEK_SET);
220  if (flux.size() > 0)
221  fread(&flux[0], 1, flux.size(), F);
222  fclose(F);
223 
225  inf->SetName("MyFeatureName");
226  inf->AddAttribute("NXNAME", Dtk_string("SolidName"));
227  //inf->SetBlankedStatus(1); // set as invisible
228  //inf->SetColor(Dtk_RGB(255, 0, 0)); // set a body color (appear on non colored faces)
229 
230  CHECK_OK(Ugw::InitFile(outputFileName, version));
231 
232  CHECK_OK(Ugw::WriteExternParasolidBody(&flux[0], flux.size(), inf));
234  std::cout << "=> " << outputFileName.c_str() << endl;
235  return dtkNoError;
236 }

◆ UgwGroups()

Dtk_ErrorStatus UgwGroups ( const Dtk_string outputFileName,
int  version 
)
337 {
339  cube1->info()->SetName("FirstCube");
341  cube2->info()->SetName("SecondCube");
342  Dtk_transfo translate(Dtk_dir(1, 0, 0), Dtk_dir(0, 1, 0), Dtk_dir(0, 0, 1), Dtk_pnt(200, 0, 0));
343  cube2->Transform(translate);
344  Dtk_MeshPtr CylMesh = sampleWriter::CreateMeshCylinder(8); // get a meshcyl (common sample)
345  CylMesh->info()->SetName("OneMesh");
346  Dtk_transfo translatescale(Dtk_dir(10, 0, 0), Dtk_dir(0, 10, 0), Dtk_dir(0, 0, 10), Dtk_pnt(-100, 0, 0));
347  CylMesh->Transform(translatescale);
349  WireBody->Transform(translatescale);
350 
351  CHECK_OK(Ugw::InitFile(outputFileName, version));
352 
353  // put cube1 in group GroupRoot/Sub1
354  cube1->info()->AddAttribute("NXGROUPS", Dtk_Val("GroupRoot\\Sub1\\"));
355 
356  // put cube1 in group GroupRoot/Sub1 and also GroupRoot/Sub2
357  cube2->info()->AddAttribute("NXGROUPS", Dtk_Val("GroupRoot\\Sub1\\\\GroupRoot\\Sub2\\"));
358 
359  // put Mesh in group GroupRoot/Sub2
360  CylMesh->info()->AddAttribute("NXGROUPS", Dtk_Val("GroupRoot\\Sub2\\"));
361 
362  // put Wire in group GroupRoot/Sub2
363  WireBody->info()->AddAttribute("NXGROUPS", Dtk_Val("GroupRoot\\Sub2\\"));
364 
365 
366  // set property to group Sub2
367  Dtk_InfoPtr infsub2 = Dtk_Info::create();
368  infsub2->SetBlankedStatus(1);
369  infsub2->SetLayer(23);
370  CHECK_OK(Ugw::SetGroupDatas("Sub2", infsub2)); // Sub2 become invisible, and on layer 23
371 
372  // make an empty group
373  Dtk_InfoPtr infsub3 = Dtk_Info::create();
374  infsub3->AddAttribute("NXGROUPS", Dtk_Val("GroupRoot\\Sub3\\"));
375  infsub3->SetLayer(19);
376  CHECK_OK(Ugw::SetGroupDatas("Sub3", infsub3)); // Sub3 become an empty group on layer 19
377 
378  // Then we write the 2 bodies constructed
379  CHECK_OK(Ugw::WriteBody(cube1));
380  CHECK_OK(Ugw::WriteBody(cube2));
381  CHECK_OK(Ugw::WriteBody(WireBody));
382  CHECK_OK(Ugw::WriteMesh(CylMesh));
383 
384  // Write final file and release the writer.
386  std::cout << "=> " << outputFileName.c_str() << endl;
387  return dtkNoError;
388 }

◆ UgwLayers()

Dtk_ErrorStatus UgwLayers ( const Dtk_string outputFileName,
int  version 
)
306 {
307  Dtk_BodyPtr CubeBody = sampleWriter::CreateCube(); // get a brepcube (common sample)
308  Dtk_MeshPtr CylMesh = sampleWriter::CreateMeshCylinder(8); // get a meshcyl (common sample)
309  Dtk_transfo translatescale(Dtk_dir(20, 0, 0), Dtk_dir(0, 20, 0), Dtk_dir(0, 0, 20), Dtk_pnt(150, 0, 0));
310  CylMesh->Transform(translatescale);
311 
312  CHECK_OK(Ugw::InitFile(outputFileName, version));
313 
314  Dtk_tab<Dtk_Int32> visible, selectable;
315  Dtk_LayerInfosSetPtr layerinfoset = CreateLayerInfosSet(visible, selectable);
316 
317  CubeBody->info()->SetLayer(5);
318  CylMesh->info()->SetLayer(6);
319 
320  CHECK_OK(Ugw::SetLayerData(layerinfoset, visible, selectable));
321 
322  // Then we write the 2 bodies constructed
323  CHECK_OK(Ugw::WriteBody(CubeBody));
324  CHECK_OK(Ugw::WriteMesh(CylMesh));
325 
326  // Write final file and release the writer.
328  std::cout << "=> " << outputFileName.c_str() << endl;
329  return dtkNoError;
330 }

◆ UgwMesh()

Dtk_ErrorStatus UgwMesh ( const Dtk_string outputFileName,
int  version 
)
75 {
76  Dtk_MeshPtr CubeMesh = sampleWriter::CreateMeshCylinder(8); // get a meshcylinder (common sample)
77  CubeMesh->info()->SetName("MyMesh");
78  CHECK_OK(Ugw::InitFile(outputFileName, version));
79  CHECK_OK(Ugw::WriteMesh(CubeMesh));
81  std::cout << "=> " << outputFileName.c_str() << endl;
82  return dtkNoError;
83 }

◆ UgwMeta()

Dtk_ErrorStatus UgwMeta ( const Dtk_string outputFileName,
int  version 
)
435 {
437 
439  def.unit = Ugw::DefaultParameters::Unit::inch;
442  def.modelingpreferences.density = 6500;
444 
445  def.background_color_top = Dtk_RGB( 255, 0, 0 );
446  def.background_color_bottom = Dtk_RGB( 0, 255, 0 );
447 
448  def.objectpreferences.def.width = 0.13;
449 
450  CHECK_OK(Ugw::InitFile(outputFileName, version, def));
451 
452  // custom metadata
453  CHECK_OK(Ugw::AddMetaData(MakeMetaData("MyPropTitle", "MyPropValue", "CategoryNX1980")));
454  CHECK_OK(Ugw::AddMetaData(MakeMetaData("MyPropTitle2", "MyPropValue2", "CategoryNX1980")));
455 
456  CHECK_OK(Ugw::WriteBody(CubeBody));
458  std::cout << "=> " << outputFileName.c_str() << endl;
459  return dtkNoError;
460 }

◆ UgwReferences()

Dtk_ErrorStatus UgwReferences ( const Dtk_string outputFileName,
int  version 
)
183 {
185  CHECK_OK(Ugw::InitFile(outputFileName, version));
186 
187  cube->info()->SetName("MyCube");
188  cube->info()->AddAttribute("NXNAME", Dtk_Val("SOLIDBODYNAME"));
189  CHECK_OK(Ugw::WriteBody(cube));
190 
196 
198  std::cout << "=> " << outputFileName.c_str() << endl;
199 
200  return dtkNoError;
201 }

◆ UgwRefSets()

Dtk_ErrorStatus UgwRefSets ( const Dtk_string outputFileName,
int  version 
)
396 {
398  cube1->info()->SetName("FirstCube");
400  cube2->info()->SetName("SecondCube");
401  Dtk_transfo translate(Dtk_dir(1, 0, 0), Dtk_dir(0, 1, 0), Dtk_dir(0, 0, 1), Dtk_pnt(200, 0, 0));
402  cube2->Transform(translate);
403 
404  // reference set
405  // Cube1 into reference set "MyRef1","MyRef2","MyRef3"
406  cube1->info()->AddAttribute("NXREFERENCESET", Dtk_Val("MyRef1\\MyRef2\\MyRef3\\"));
407  // Cube2 into reference set "MyRef1","MyRef3"
408  cube2->info()->AddAttribute("NXREFERENCESET", Dtk_Val("MyRef1\\MyRef3\\"));
409 
410  CHECK_OK(Ugw::InitFile(outputFileName, version));
411 
412  // Then we write the 2 bodies constructed
413  CHECK_OK(Ugw::WriteBody(cube1));
414  CHECK_OK(Ugw::WriteBody(cube2));
415 
416  // Write final file and release the writer.
418  std::cout << "=> " << outputFileName.c_str() << endl;
419  return dtkNoError;
420 }

◆ UgWriteSample()

int UgWriteSample ( const Dtk_string inResultDirectory)
766 {
767  Dtk_string outputDirectory, nxDirectory;
768  Dtk_ErrorStatus errStatus;
769 
770  std::cout << endl << "----------------------------------------------" << endl;
771  std::cout << "Ug Write start" << endl;
772 
773  nxDirectory = inResultDirectory + L"NX-Unigraphics/";
774  nxDirectory.FixPathSeparator();
775  nxDirectory.mkdir();
776 
777  // Choosing output for version NX5
778  outputDirectory = inResultDirectory + L"NX-Unigraphics/nx5/";
779  outputDirectory.FixPathSeparator();
780  outputDirectory.mkdir();
781  errStatus = UgWriteSampleVersion(outputDirectory, DTK_UGW_VERSION_NX5);
782 
783  // Choosing output for version NX1980
784  outputDirectory = inResultDirectory + L"NX-Unigraphics/nx1980/";
785  outputDirectory.FixPathSeparator();
786  outputDirectory.mkdir();
787  errStatus = UgWriteSampleVersion(outputDirectory, DTK_UGW_VERSION_NX1980);
788 
789  // Choosing output for version NX2212
790  outputDirectory = inResultDirectory + L"NX-Unigraphics/nx2212/";
791  outputDirectory.FixPathSeparator();
792  outputDirectory.mkdir();
793  errStatus = UgWriteSampleVersion(outputDirectory, DTK_UGW_VERSION_NX2212);
794 
795  std::cout << "Ug Write end" << endl;
796 
797  return errStatus;
798 }

◆ UgWriteSampleVersion()

Dtk_ErrorStatus UgWriteSampleVersion ( const Dtk_string outputDirectory,
int  version 
)
694 {
695  Dtk_string outputFileName;
696  Dtk_ErrorStatus errStatus;
697 
698  // sample 1.1 : one body
699  outputFileName = outputDirectory + L"simplebody.prt";
700  errStatus = UgwSimpleBody(outputFileName, version);
701 
702  // sample 1.2 : just write 2 bodies
703  outputFileName = outputDirectory + L"twobodies.prt";
704  errStatus = UgwTwoBodies(outputFileName, version);
705 
706  // sample 1.3 : mesh
707  outputFileName = outputDirectory + L"mesh.prt";
708  errStatus = UgwMesh(outputFileName, version);
709 
710  // sample 1.4 : wire
711  outputFileName = outputDirectory + L"wire.prt";
712  errStatus = UgwWire(outputFileName, version);
713 
714  // sample 1.5 : References
715  outputFileName = outputDirectory + L"refs.prt";
716  errStatus = UgwReferences(outputFileName, version);
717 
718  // sample 1.6 : Extern Parasolid
719  outputFileName = outputDirectory + L"extparasolid.prt";
720  errStatus = UgwExternParasolid(outputFileName, "../SampleFiles/Parasolid/extparasolid.x_b", version);
721 
722  // sample 1.7 : Extern JT
723  outputFileName = outputDirectory + L"extjt.prt";
724  errStatus = UgwExternJTMesh(outputFileName, "../SampleFiles/JT/externjt.jt", version);
725 
726  // sample 2.1 : Layer filters
727  outputFileName = outputDirectory + L"layers.prt";
728  errStatus = UgwLayers(outputFileName, version);
729 
730  // sample 2.2 : Groups
731  outputFileName = outputDirectory + L"groups.prt";
732  errStatus = UgwGroups(outputFileName, version);
733 
734  // sample 2.3 : Reference Sets
735  outputFileName = outputDirectory + L"refsets.prt";
736  errStatus = UgwRefSets(outputFileName, version);
737 
738  // sample 2.4 : MetaDatas, units, modeling preferences
739  outputFileName = outputDirectory + L"meta.prt";
740  errStatus = UgwMeta(outputFileName, version);
741 
742  // sample 2.5 : Colors
743  outputFileName = outputDirectory + L"colors.prt";
744  errStatus = UgwColors(outputFileName, version);
745 
746  // sample 3.1 : Simple Assembly
747  outputFileName = outputDirectory + L"asm.prt";
748  errStatus = UgwAsm(outputFileName, version);
749 
750  // sample 3.2 : Extern Assembly
751  outputFileName = outputDirectory + L"externasm.prt";
752  errStatus = UgwExternAsm(outputFileName, version);
753 
754  // sample 4.1 : Annotation
755  outputFileName = outputDirectory + L"annot.prt";
756  errStatus = UgwAnnot(outputFileName, version);
757 
758  return errStatus;
759 }

◆ UgwSimpleBody()

Dtk_ErrorStatus UgwSimpleBody ( const Dtk_string outputFileName,
int  version 
)
18 {
19  // Cube Sample
21 
22  //CubeBody->info()->AddAttribute("MATERIALNAME", Dtk_string("Ash Gloss"));
23  // First we initialize writer with name of output file (see macro CHECK_OK above)
24 
25  CHECK_OK(Ugw::InitFile(outputFileName, version));
26 
27 
28  // Then we write the body constructed
29  CHECK_OK(Ugw::WriteBody(CubeBody));
30 
31  // Write final file and release the writer.
33  std::cout << "=> " << outputFileName.c_str() << endl;
34 
35  return dtkNoError;
36 }

◆ UgwTwoBodies()

Dtk_ErrorStatus UgwTwoBodies ( const Dtk_string outputFileName,
int  version 
)
43 {
44  // Cube Sample
46 
47  // We construct 2 cubes, translating the second
49  cube1->info()->SetName("FirstCube");
51  cube2->info()->SetName("SecondCube");
52 
53  Dtk_transfo translate(Dtk_dir(1, 0, 0), Dtk_dir(0, 1, 0), Dtk_dir(0, 0, 1), Dtk_pnt(200, 0, 0));
54  cube2->Transform(translate);
55 
56  // First we initialize writing with name of output file (see macro CHECK_OK above)
57  CHECK_OK(Ugw::InitFile(outputFileName, version));
58 
59  // Then we write the 2 bodies constructed
60  CHECK_OK(Ugw::WriteBody(cube1));
61  CHECK_OK(Ugw::WriteBody(cube2));
62 
63  // Write final file and release the writer.
65  std::cout << "=> " << outputFileName.c_str() << endl;
66 
67  return dtkNoError;
68 }

◆ UgwWire()

Dtk_ErrorStatus UgwWire ( const Dtk_string outputFileName,
int  version 
)
90 {
92  CHECK_OK(Ugw::InitFile(outputFileName, version));
93  CHECK_OK(Ugw::WriteBody(WireBody));
95  std::cout << "=> " << outputFileName.c_str() << endl;
96  return dtkNoError;
97 }
UgwGroups
Dtk_ErrorStatus UgwGroups(const Dtk_string &outputFileName, int version)
Definition: testlibugwrite.cpp:336
Dtk_TextStyle::Ratio
Dtk_Double64 & Ratio()
Retrieves the text ratio - get/set -.
MakeInstanceData
Dtk_InfoPtr MakeInstanceData(const Dtk_string &instancename, const Dtk_RGB &col, bool visible, int layer)
Definition: testlibugwrite.cpp:492
UgwRefSets
Dtk_ErrorStatus UgwRefSets(const Dtk_string &outputFileName, int version)
Definition: testlibugwrite.cpp:395
Dtk_InfoPtr
Dtk_SmartPtr< Dtk_Info > Dtk_InfoPtr
Handles a Dtk_Info object.
Definition: util_ptr_dtk.hpp:310
UgwExternParasolid
Dtk_ErrorStatus UgwExternParasolid(const Dtk_string &outputFileName, const Dtk_string &parasolidfic, int version)
Definition: testlibugwrite.cpp:208
Ugw::DefaultParameters
Definition: ugw.hpp:14
UgwExternAsm
Dtk_ErrorStatus UgwExternAsm(const Dtk_string &outputFileName, int version)
Definition: testlibugwrite.cpp:569
Dtk_transfo
This is the Transformation dedicated class.
Definition: dtk_transfo.hpp:19
Ugw::WriteAxisSystem
Dtk_ErrorStatus WriteAxisSystem(const Dtk_AxisSystemPtr &inAxisSystem)
Add an axis system into the current node.
MakeRefAxis
Dtk_BodyPtr MakeRefAxis()
Definition: testlibugwrite.cpp:151
UgwColors
Dtk_ErrorStatus UgwColors(const Dtk_string &outputFileName, int version)
Definition: testlibugwrite.cpp:467
Dtk_TextStyle::Justification
TextJustificationEnum & Justification()
Retrieves the text justification - get/set -.
Dtk_TextStyle::JustificationLeft
@ JustificationLeft
Definition: util_draw_dtk.hpp:299
Ugw::DefaultParameters::objectpreferences
ObjectPreferences objectpreferences
Definition: ugw.hpp:47
Dtk_PlaneSurface::Create
static Dtk_PlaneSurfacePtr Create(const Dtk_pnt &inOrigin, const Dtk_dir &inNormal, const Dtk_dir &inUDirection, const Dtk_dir &inVDirection=Dtk_dir())
Create an infinite plane surface.
UgwLayers
Dtk_ErrorStatus UgwLayers(const Dtk_string &outputFileName, int version)
Definition: testlibugwrite.cpp:305
Ugw::SetColorInTable
Dtk_ErrorStatus SetColorInTable(size_t inIth, const Dtk_RGB &inColor, const Dtk_string &inColorname)
Replace color value and color name on the palette.
Dtk_TextStyle
This is the text_style. This class gathers several informations about text style.
Definition: util_draw_dtk.hpp:260
dtkErrorFileNotExist
@ dtkErrorFileNotExist
Definition: error_dtk.hpp:99
MakeRefPlane
Dtk_BodyPtr MakeRefPlane()
Definition: testlibugwrite.cpp:117
UgwMeta
Dtk_ErrorStatus UgwMeta(const Dtk_string &outputFileName, int version)
Definition: testlibugwrite.cpp:434
Ugw::AddExternInstance
Dtk_ErrorStatus AddExternInstance(const Dtk_string &inProtoFileName, const Dtk_transfo &inTrans, Dtk_InfoPtr inInfos, void(*innxread_getdata)(const Dtk_string &, void *&))
Open an extern file to add as instance in current assembly, inProtoFileName must be in the output dir...
DTK_TRUE
#define DTK_TRUE
Definition: define.h:727
DTK_UGW_VERSION_NX5
#define DTK_UGW_VERSION_NX5
Definition: ugw.hpp:7
dtk_text_type_value
@ dtk_text_type_value
Definition: str_def.h:14
Dtk_string
This is a high level string class.
Definition: dtk_string.hpp:58
Ugw::WriteReferenceGeometry
Dtk_ErrorStatus WriteReferenceGeometry(const Dtk_BodyPtr &inRefgeom)
Add a reference geometry into the current node.
UgwAnnot
Dtk_ErrorStatus UgwAnnot(const Dtk_string &outputFileName, int version)
Definition: testlibugwrite.cpp:669
Ugw::WriteExternJtMesh
Dtk_ErrorStatus WriteExternJtMesh(const char *inFlux, size_t inSize, const Dtk_InfoPtr &inInf)
Add a JT file as lightweight body inside the file.
Dtk_Text
This is the base text class. It's part of Dtk_CompositeText. It's used into a lot of 2D Entities It c...
Definition: util_draw_dtk.hpp:1126
Dtk_AxisSystem::create
static Dtk_SmartPtr< Dtk_AxisSystem > create()
Dtk_Body::Create
static Dtk_BodyPtr Create()
Create a body.
Ugw::WriteBody
Dtk_ErrorStatus WriteBody(const Dtk_BodyPtr &inBody)
Add a body inside the file.
Dtk_string::OpenFile
FILE * OpenFile(const Dtk_string &inRights) const
File Utility : Open a file with the given rights.
MakeFixedRefPlane
Dtk_BodyPtr MakeFixedRefPlane()
Definition: testlibugwrite.cpp:133
UgwSimpleBody
Dtk_ErrorStatus UgwSimpleBody(const Dtk_string &outputFileName, int version)
Definition: testlibugwrite.cpp:17
DTK_SOLIDLINE
@ DTK_SOLIDLINE
Definition: util_ent_dtk.hpp:49
Dtk_Symbol::Create
static Dtk_SymbolPtr Create()
Base constructor.
Ugw::SetLayerData
Dtk_ErrorStatus SetLayerData(const Dtk_LayerInfosSetPtr &inLayerDataSet, const Dtk_tab< Dtk_Int32 > &inVisibles=Dtk_tab< Dtk_Int32 >(), const Dtk_tab< Dtk_Int32 > &inSelectables=Dtk_tab< Dtk_Int32 >())
define Data for layers
Dtk_string::add_int
void add_int(const int integer, int force_unsigned_int=0)
concat an int to the Dtk_string (convert the int to Dtk_string)
Dtk_Val
Definition: dtk_val.hpp:67
UgwMesh
Dtk_ErrorStatus UgwMesh(const Dtk_string &outputFileName, int version)
Definition: testlibugwrite.cpp:74
Dtk_Face::Create
static Dtk_FacePtr Create(const Dtk_BodyPtr &inParentBody)
Create a face in a body.
UGW_Sample_MakePMI
Dtk_FdtPtr UGW_Sample_MakePMI()
Definition: testlibugwrite.cpp:603
MakeAxisSystem
Dtk_AxisSystemPtr MakeAxisSystem()
Definition: testlibugwrite.cpp:105
Ugw::DefaultParameters::ModelingPreferences::distance_tolerance
double distance_tolerance
Definition: ugw.hpp:23
Dtk_Line::Create
static Dtk_LinePtr Create(const Dtk_Line &inLineToCopy)
constructors returning Smart pointers
Dtk_tab::resize
void resize(Dtk_Size_t n, const T &t)
Resizes the array.
Definition: util_stl_dtk.hpp:605
Ugw::WritePMI
Dtk_ErrorStatus WritePMI(const Dtk_FdtPtr &inPmi)
Add a pmi inside the file.
Ugw::WriteExternParasolidBody
Dtk_ErrorStatus WriteExternParasolidBody(const char *inFlux, size_t inSize, const Dtk_InfoPtr &inInf)
Add a Parasolid file as body inside the file.
Dtk_MetaData::TypeProperty
@ TypeProperty
Definition: dtk_metadata.hpp:28
Ugw::CloseLastInstance
Dtk_ErrorStatus CloseLastInstance()
Close the last instance.
Ugw::DefaultParameters::background_color_top
Dtk_RGB background_color_top
Definition: ugw.hpp:36
DTK_PHANTOM
@ DTK_PHANTOM
Definition: util_ent_dtk.hpp:53
Ugw::SetGroupDatas
Dtk_ErrorStatus SetGroupDatas(const Dtk_string &inGroupName, Dtk_InfoPtr inInfos)
define Visibility for a specific group
Dtk_SmartPtr::DtkDynamicCast
static Dtk_SmartPtr< T > DtkDynamicCast(const Dtk_SmartPtr< T2 > &p)
Definition: util_ptr_dtk.hpp:101
Dtk_ErrorStatus
Dtk_ErrorStatus
Definition: error_dtk.hpp:6
Ugw::DefaultParameters::ObjectPreferences::def
General def
Definition: ugw.hpp:45
Dtk_Fdt::Create
static Dtk_FdtPtr Create()
Base constructor.
Dtk_Face::SetGeom
void SetGeom(const Dtk_SurfacePtr &inSurface)
Set Geometry.
CHECK_OK
#define CHECK_OK(X)
Definition: testwriters.h:9
Dtk_SmartPtr
Definition: util_ptr_dtk.hpp:37
Dtk_string::c_str
const char * c_str() const
Retrieve the ASCII conversion string.
sampleWriter::CreateMeshCylinder
Dtk_MeshPtr CreateMeshCylinder(int nbpoints)
Mesh Cylinder sample.
Definition: testcreatemesh.cpp:337
UgwTwoBodies
Dtk_ErrorStatus UgwTwoBodies(const Dtk_string &outputFileName, int version)
Definition: testlibugwrite.cpp:42
Ugw::DefaultParameters::background_color_bottom
Dtk_RGB background_color_bottom
Definition: ugw.hpp:36
Ugw::DefaultParameters::modelingpreferences
ModelingPreferences modelingpreferences
Definition: ugw.hpp:35
Dtk_string::mkdir
int mkdir() const
File Utility : Create a Directory.
Dtk_pnt
This is a mathematical point class.
Definition: dtk_pnt.hpp:22
UgWriteSampleVersion
Dtk_ErrorStatus UgWriteSampleVersion(const Dtk_string &outputDirectory, int version)
Definition: testlibugwrite.cpp:693
UgwAsm
Dtk_ErrorStatus UgwAsm(const Dtk_string &outputFileName, int version)
Definition: testlibugwrite.cpp:504
Ugw::DefaultParameters::unit
Unit unit
Definition: ugw.hpp:19
Dtk_string::FixPathSeparator
void FixPathSeparator()
File Utility : Fixes path separator consistency. It lets you replace the '\' or '/' by the OS needed ...
Dtk_CompositeText
This is the composite text class. It's basically a Dtk_Text Container. This class represents a group ...
Definition: util_draw_dtk.hpp:1557
Ugw::DefaultParameters::ModelingPreferences::density
double density
Definition: ugw.hpp:25
Ugw::DefaultParameters::ModelingPreferences::density_unit
DensityUnit density_unit
Definition: ugw.hpp:30
Ugw::DefaultParameters::ModelingPreferences::lb_ft3
@ lb_ft3
Definition: ugw.hpp:28
Dtk_Leader::Create
static Dtk_LeaderPtr Create()
Base constructor.
MakeMetaData
Dtk_MetaDataPtr MakeMetaData(const Dtk_string &propname, const Dtk_string &value, const Dtk_string &category="")
Definition: testlibugwrite.cpp:427
Dtk_TextStyle::CharHeight
Dtk_Double64 & CharHeight()
Retrieves the char height - get/set -.
NX_RETRIEVE_ASSEMBLYDATA
#define NX_RETRIEVE_ASSEMBLYDATA
Definition: testlibugwrite.cpp:565
Dtk_tab< Dtk_Size_t >
CreateLayerInfosSet
Dtk_LayerInfosSetPtr CreateLayerInfosSet(Dtk_tab< Dtk_Int32 > &visible, Dtk_tab< Dtk_Int32 > &selectable)
Definition: testlibugwrite.cpp:276
Ugw::WriteMesh
Dtk_ErrorStatus WriteMesh(const Dtk_MeshPtr &inMesh)
Add a mesh inside the file.
Dtk_transfo::addTranslate
void addTranslate(const Dtk_dir &V)
Translate the Dtk_transfo.
sampleWriter::CreateCube
Dtk_BodyPtr CreateCube()
Definition: testcreatecube.cpp:1249
Dtk_tab::size
Dtk_Size_t size() const
Returns the size of the array.
Definition: util_stl_dtk.hpp:504
Ugw::AddMetaData
Dtk_ErrorStatus AddMetaData(const Dtk_MetaDataPtr &inMeta)
Add a MetaData in the current component.
DTK_UGW_VERSION_NX1980
#define DTK_UGW_VERSION_NX1980
Definition: ugw.hpp:8
Ugw::InitFile
Dtk_ErrorStatus InitFile(const Dtk_string &inFilename, int inVersiontowrite=45, const DefaultParameters &inDef=DefaultParameters())
Initialize UG Writer.
UgwWire
Dtk_ErrorStatus UgwWire(const Dtk_string &outputFileName, int version)
Definition: testlibugwrite.cpp:89
UgwReferences
Dtk_ErrorStatus UgwReferences(const Dtk_string &outputFileName, int version)
Definition: testlibugwrite.cpp:182
Ugw::OpenInstance
Dtk_ErrorStatus OpenInstance(const Dtk_string &inInstanceName, const Dtk_string &inProtoFileName, Dtk_bool &outWasAlreadyInstancied, const Dtk_transfo &inTrans, const Dtk_RGB &inRgb)
deprecated
DTK_RB
#define DTK_RB
Definition: dtk_string.hpp:40
Ugw::DefaultParameters::ModelingPreferences::angle_tolerance
double angle_tolerance
Definition: ugw.hpp:24
UgwExternJTMesh
Dtk_ErrorStatus UgwExternJTMesh(const Dtk_string &outputFileName, const Dtk_string &jtfic, int version)
Definition: testlibugwrite.cpp:242
Dtk_Leader::LeaderTerminatorTypeEnum
LeaderTerminatorTypeEnum
Internal leader terminator type.
Definition: util_draw_dtk.hpp:1999
Ugw::DefaultParameters::ObjectPreferences::General::width
Dtk_Double64 width
Definition: ugw.hpp:42
sampleWriter::CreateCurves
Dtk_BodyPtr CreateCurves()
Definition: testcreatecube.cpp:1292
Dtk_LayerInfosSet::Create
static Dtk_LayerInfosSetPtr Create(const Dtk_Size_t inNumLayers)
Base constructor.
dtkNoError
@ dtkNoError
Definition: error_dtk.hpp:144
Dtk_tab::push_back
void push_back(const T &x)
Inserts an element at the end of the array.
Definition: util_stl_dtk.hpp:417
Dtk_Shell::Create
static Dtk_ShellPtr Create(const Dtk_BodyPtr &inParentBody)
Create a shell in a body.
MakeRefPoint
Dtk_BodyPtr MakeRefPoint()
Definition: testlibugwrite.cpp:167
Dtk_Point::Create
static Dtk_PointPtr Create(const Dtk_Point &inToCopy)
constructors returning Smart pointers
Dtk_CompositeText::AddText
void AddText(Dtk_Text inText)
Adds a Dtk_Text to the Dtk_CompositeText.
Dtk_RGB
Definition: dtk_rgb.hpp:7
Dtk_Info::create
static Dtk_SmartPtr< Dtk_Info > create()
Dtk_Oriented2dBBox
This is the base bounding box class. It's used into a lot of 2D Entities This class represents the ba...
Definition: util_draw_dtk.hpp:479
Dtk_dir
This is a mathematical direction class.
Definition: dtk_dir.hpp:15
DTK_UGW_VERSION_NX2212
#define DTK_UGW_VERSION_NX2212
Definition: ugw.hpp:9
Dtk_Leader::TerminatorTypeFillArrow
@ TerminatorTypeFillArrow
Definition: util_draw_dtk.hpp:2007
Ugw::EndFile
Dtk_ErrorStatus EndFile()
Close the UG file.
Dtk_MetaData::CreateMetaData
static Dtk_MetaDataPtr CreateMetaData(const MetaDataTypeEnum &inEnumType, Dtk_string inTitle, Dtk_string inValue, Dtk_string inValueType=Dtk_string(L"STRING"))
Create a Dtk_MetaDataPtr .
DTK_PI
#define DTK_PI
Definition: str_def.h:8