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

◆ MakeAxisSystem()

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

◆ MakeFixedRefPlane()

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

◆ MakeInstanceData()

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

◆ MakeMetaData()

Dtk_MetaDataPtr MakeMetaData ( const Dtk_string propname,
const Dtk_string value,
const Dtk_string category = "" 
)
424 {
426  meta->SetCategory(category);
427  return meta;
428 }

◆ MakeRefAxis()

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

◆ MakeRefPlane()

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

◆ MakeRefPoint()

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

◆ UGW_Sample_MakePMI()

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

◆ UgwAnnot()

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

◆ UgwAsm()

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

◆ UgwColors()

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

◆ UgwExternAsm()

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

◆ UgwExternJTMesh()

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

◆ UgwExternParasolid()

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

◆ UgwGroups()

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

◆ UgwLayers()

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

◆ UgwMesh()

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

◆ UgwMeta()

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

◆ UgwReferences()

Dtk_ErrorStatus UgwReferences ( const Dtk_string outputFileName,
int  version 
)
179 {
181  CHECK_OK(Ugw::InitFile(outputFileName, version));
182 
183  cube->info()->SetName("MyCube");
184  cube->info()->AddAttribute("NXNAME", Dtk_Val("SOLIDBODYNAME"));
185  CHECK_OK(Ugw::WriteBody(cube));
186 
192 
194  std::cout << "=> " << outputFileName.c_str() << endl;
195 
196  return dtkNoError;
197 }

◆ UgwRefSets()

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

◆ UgWriteSample()

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

◆ UgWriteSampleVersion()

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

◆ UgwSimpleBody()

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

◆ UgwTwoBodies()

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

◆ UgwWire()

Dtk_ErrorStatus UgwWire ( const Dtk_string outputFileName,
int  version 
)
86 {
88  CHECK_OK(Ugw::InitFile(outputFileName, version));
89  CHECK_OK(Ugw::WriteBody(WireBody));
91  std::cout << "=> " << outputFileName.c_str() << endl;
92  return dtkNoError;
93 }
UgwGroups
Dtk_ErrorStatus UgwGroups(const Dtk_string &outputFileName, int version)
Definition: testlibugwrite.cpp:332
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:489
UgwRefSets
Dtk_ErrorStatus UgwRefSets(const Dtk_string &outputFileName, int version)
Definition: testlibugwrite.cpp:391
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:204
Ugw::DefaultParameters
Definition: ugw.hpp:14
UgwExternAsm
Dtk_ErrorStatus UgwExternAsm(const Dtk_string &outputFileName, int version)
Definition: testlibugwrite.cpp:566
Dtk_transfo
This is the Transformation dedicated class.
Definition: dtk_transfo.hpp:19
Ugw::DefaultParameters::ObjectPreferences::solid_body
General solid_body
Definition: ugw.hpp:45
Ugw::WriteAxisSystem
Dtk_ErrorStatus WriteAxisSystem(const Dtk_AxisSystemPtr &inAxisSystem)
Add an axis system into the current node.
MakeRefAxis
Dtk_BodyPtr MakeRefAxis()
Definition: testlibugwrite.cpp:147
UgwColors
Dtk_ErrorStatus UgwColors(const Dtk_string &outputFileName, int version)
Definition: testlibugwrite.cpp:464
Dtk_TextStyle::Justification
TextJustificationEnum & Justification()
Retrieves the text justification - get/set -.
Dtk_TextStyle::JustificationLeft
@ JustificationLeft
Definition: util_draw_dtk.hpp:289
Ugw::DefaultParameters::objectpreferences
ObjectPreferences objectpreferences
Definition: ugw.hpp:52
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:301
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 information about text style.
Definition: util_draw_dtk.hpp:250
dtkErrorFileNotExist
@ dtkErrorFileNotExist
Definition: error_dtk.hpp:99
MakeRefPlane
Dtk_BodyPtr MakeRefPlane()
Definition: testlibugwrite.cpp:113
UgwMeta
Dtk_ErrorStatus UgwMeta(const Dtk_string &outputFileName, int version)
Definition: testlibugwrite.cpp:430
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:730
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:53
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:666
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:1110
Dtk_AxisSystem::create
static Dtk_SmartPtr< Dtk_AxisSystem > create()
Calls default constructor to allocate a new object.
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:129
UgwSimpleBody
Dtk_ErrorStatus UgwSimpleBody(const Dtk_string &outputFileName, int version)
Definition: testlibugwrite.cpp:13
DTK_SOLIDLINE
@ DTK_SOLIDLINE
Definition: util_ent_dtk.hpp:47
Dtk_Symbol::Create
static Dtk_SymbolPtr Create()
Calls default constructor to allocate a new object.
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:70
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:600
MakeAxisSystem
Dtk_AxisSystemPtr MakeAxisSystem()
Definition: testlibugwrite.cpp:101
Ugw::DefaultParameters::ModelingPreferences::distance_tolerance
double distance_tolerance
Definition: ugw.hpp:23
Dtk_tab::resize
void resize(Dtk_Size_t n, const T &t)
Resizes the array.
Definition: util_stl_dtk.hpp:604
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:51
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()
Calls default constructor to allocate a new object.
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.
Dtk_Point::Create
static Dtk_PointPtr Create(const Dtk_Point &in)
Calls copy constructor to allocate a new object.
sampleWriter::CreateMeshCylinder
Dtk_MeshPtr CreateMeshCylinder(int nbpoints)
Mesh Cylinder sample.
Definition: testcreatemesh.cpp:334
UgwTwoBodies
Dtk_ErrorStatus UgwTwoBodies(const Dtk_string &outputFileName, int version)
Definition: testlibugwrite.cpp:38
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:20
UgWriteSampleVersion
Dtk_ErrorStatus UgWriteSampleVersion(const Dtk_string &outputDirectory, int version)
Definition: testlibugwrite.cpp:690
UgwAsm
Dtk_ErrorStatus UgwAsm(const Dtk_string &outputFileName, int version)
Definition: testlibugwrite.cpp:501
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:1525
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()
Calls default constructor to allocate a new object.
MakeMetaData
Dtk_MetaDataPtr MakeMetaData(const Dtk_string &propname, const Dtk_string &value, const Dtk_string &category="")
Definition: testlibugwrite.cpp:423
Dtk_Line::Create
static Dtk_LinePtr Create(const Dtk_Line &in)
Calls copy constructor to allocate a new object.
Dtk_TextStyle::CharHeight
Dtk_Double64 & CharHeight()
Retrieves the char height - get/set -.
NX_RETRIEVE_ASSEMBLYDATA
#define NX_RETRIEVE_ASSEMBLYDATA
Definition: testlibugwrite.cpp:562
Dtk_tab< Dtk_Size_t >
CreateLayerInfosSet
Dtk_LayerInfosSetPtr CreateLayerInfosSet(Dtk_tab< Dtk_Int32 > &visible, Dtk_tab< Dtk_Int32 > &selectable)
Definition: testlibugwrite.cpp:272
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:1316
Dtk_tab::size
Dtk_Size_t size() const
Returns the size of the array.
Definition: util_stl_dtk.hpp:503
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:85
UgwReferences
Dtk_ErrorStatus UgwReferences(const Dtk_string &outputFileName, int version)
Definition: testlibugwrite.cpp:178
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:35
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:238
Dtk_Leader::LeaderTerminatorTypeEnum
LeaderTerminatorTypeEnum
Internal leader terminator type.
Definition: util_draw_dtk.hpp:1955
Ugw::DefaultParameters::ObjectPreferences::General::width
Dtk_Double64 width
Definition: ugw.hpp:42
sampleWriter::CreateCurves
Dtk_BodyPtr CreateCurves()
Definition: testcreatecube.cpp:1357
Dtk_LayerInfosSet::Create
static Dtk_LayerInfosSetPtr Create(const Dtk_Size_t inNumLayers)
Calls a constructor to allocate a new object.
dtkNoError
@ dtkNoError
Definition: error_dtk.hpp:147
Dtk_tab::push_back
void push_back(const T &x)
Inserts an element at the end of the array.
Definition: util_stl_dtk.hpp:416
Dtk_Shell::Create
static Dtk_ShellPtr Create(const Dtk_BodyPtr &inParentBody)
Create a shell in a body.
MakeRefPoint
Dtk_BodyPtr MakeRefPoint()
Definition: testlibugwrite.cpp:163
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()
Calls default constructor to allocate a new object.
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:468
Dtk_dir
This is a mathematical direction class.
Definition: dtk_dir.hpp:14
DTK_UGW_VERSION_NX2212
#define DTK_UGW_VERSION_NX2212
Definition: ugw.hpp:9
Dtk_Leader::TerminatorTypeFillArrow
@ TerminatorTypeFillArrow
Definition: util_draw_dtk.hpp:1963
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