DATAKIT API  V2025.4
sampleWriter Namespace Reference

Enumerations

enum  {
  Lump = 1, Volume = 2, Shell = 3, Vertex_A = 9,
  Vertex_B = 11, Vertex_C = 17, Vertex_D = 23, Vertex_E = 37,
  Vertex_F = 45, Vertex_G = 63, Vertex_H = 81, Edge_AB = 14,
  Edge_CA = 20, Edge_DC = 26, Edge_BD = 30, Edge_EA = 40,
  Edge_FB = 48, Edge_FE = 52, Edge_GD = 66, Edge_GF = 70,
  Edge_HC = 84, Edge_HG = 88, Edge_EH = 96, Coedge0_AB = 8,
  Coedge1_AB = 42, Coedge0_CA = 16, Coedge5_CA = 112, Coedge0_DC = 22,
  Coedge3_DC = 78, Coedge0_BD = 28, Coedge2_BD = 60, Coedge1_EA = 36,
  Coedge5_EA = 114, Coedge1_FB = 44, Coedge2_FB = 58, Coedge1_FE = 50,
  Coedge2_GD = 62, Coedge3_GD = 76, Coedge4_FE = 98, Coedge2_GF = 68,
  Coedge4_GF = 100, Coedge3_HC = 80, Coedge5_HC = 110, Coedge3_HG = 86,
  Coedge4_HG = 102, Coedge4_EH = 94, Coedge5_EH = 108, Loop0_ABCD = 7,
  Loop1_ABFE = 35, Loop2_FBDG = 57, Loop3_GDCH = 75, Loop4_EFGH = 93,
  Loop5_EHCA = 107, FaceABCD = 5, FaceABFE = 33, FaceFBDG = 55,
  FaceGDCH = 73, FaceEFGH = 91, FaceEHCA = 105
}
 

Functions

Dtk_BodyPtr CreateAxis ()
 
Dtk_AxisSystemPtr CreateAxisSystem ()
 
Dtk_BodyPtr CreateConstructionPlane ()
 
Dtk_BodyPtr CreateCube ()
 
Dtk_BodyPtr CreateCube_2 ()
 
Dtk_RenderInfosPtr CreateCubeRenderInfos ()
 
Dtk_BodyPtr CreateCurves ()
 
Dtk_BodyPtr CreateCurves_2 ()
 
Dtk_BodyPtr CreateCurvesStyle ()
 
Dtk_BodyPtr CreateCyl (double radius, double height)
 
Dtk_BodyPtr CreateCylinder ()
 
Dtk_FdtPtr CreateDimension ()
 
Dtk_BodyPtr CreateEsquisse2D ()
 
Dtk_BodyPtr CreateEsquisse3D ()
 
Dtk_FdtPtr CreateFdtDatum ()
 Creates simple Datum. More...
 
Dtk_FdtPtr CreateGeometricalTolerance ()
 
Dtk_BodyPtr CreateInfinitePlane ()
 
Dtk_MeshPtr CreateMeshCube ()
 Mesh Cube sample. More...
 
Dtk_MeshPtr CreateMeshCubeVertexColor ()
 
Dtk_MeshPtr CreateMeshCuboid (const Dtk_pnt &inFirstPoint, const Dtk_pnt &inSecondPoint)
 
Dtk_MeshPtr CreateMeshCylinder (int nbpoints)
 Mesh Cylinder sample. More...
 
Dtk_MeshPtr CreateMeshPoints ()
 Points mesh sample. More...
 
Dtk_MeshPtr CreateMeshWire ()
 Wire mesh sample. More...
 
Dtk_BodyPtr CreateMixedBody ()
 
Dtk_ModelDisplayPtr CreateModelDisplayActivated ()
 
Dtk_ModelDisplayPtr CreateModelDisplayDesactivated ()
 
Dtk_ModelDisplayPtr CreateModelDisplayWithSection ()
 
Dtk_BodyPtr CreateOpenShell ()
 
Dtk_BodyPtr CreateOpenShell_2 ()
 
Dtk_BodyPtr CreatePoint ()
 
Dtk_MeshPtr CreateTexturedMeshCube (const Dtk_string &inImageDirectory)
 Textured Mesh Cube sample. More...
 
void FillFacesColors (Dtk_MeshPtr &inoutCubeMesh)
 Filling mesh faces with colors. More...
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
Lump 
Volume 
Shell 
Vertex_A 
Vertex_B 
Vertex_C 
Vertex_D 
Vertex_E 
Vertex_F 
Vertex_G 
Vertex_H 
Edge_AB 
Edge_CA 
Edge_DC 
Edge_BD 
Edge_EA 
Edge_FB 
Edge_FE 
Edge_GD 
Edge_GF 
Edge_HC 
Edge_HG 
Edge_EH 
Coedge0_AB 
Coedge1_AB 
Coedge0_CA 
Coedge5_CA 
Coedge0_DC 
Coedge3_DC 
Coedge0_BD 
Coedge2_BD 
Coedge1_EA 
Coedge5_EA 
Coedge1_FB 
Coedge2_FB 
Coedge1_FE 
Coedge2_GD 
Coedge3_GD 
Coedge4_FE 
Coedge2_GF 
Coedge4_GF 
Coedge3_HC 
Coedge5_HC 
Coedge3_HG 
Coedge4_HG 
Coedge4_EH 
Coedge5_EH 
Loop0_ABCD 
Loop1_ABFE 
Loop2_FBDG 
Loop3_GDCH 
Loop4_EFGH 
Loop5_EHCA 
FaceABCD 
FaceABFE 
FaceFBDG 
FaceGDCH 
FaceEFGH 
FaceEHCA 
15  {
16  Lump = 1,
17  Volume = 2,
18  Shell = 3,
19  Vertex_A = 9,
20  Vertex_B = 11,
21  Vertex_C = 17,
22  Vertex_D = 23,
23  Vertex_E = 37,
24  Vertex_F = 45,
25  Vertex_G = 63,
26  Vertex_H = 81,
27  Edge_AB = 14,
28  Edge_CA = 20,
29  Edge_DC = 26,
30  Edge_BD = 30,
31  Edge_EA = 40,
32  Edge_FB = 48,
33  Edge_FE = 52,
34  Edge_GD = 66,
35  Edge_GF = 70,
36  Edge_HC = 84,
37  Edge_HG = 88,
38  Edge_EH = 96,
39  Coedge0_AB = 8,
40  Coedge1_AB = 42,
41  Coedge0_CA = 16,
42  Coedge5_CA = 112,
43  Coedge0_DC = 22,
44  Coedge3_DC = 78,
45  Coedge0_BD = 28,
46  Coedge2_BD = 60,
47  Coedge1_EA = 36,
48  Coedge5_EA = 114,
49  Coedge1_FB = 44,
50  Coedge2_FB = 58,
51  Coedge1_FE = 50,
52  Coedge2_GD = 62,
53  Coedge3_GD = 76,
54  Coedge4_FE = 98,
55  Coedge2_GF = 68,
56  Coedge4_GF = 100,
57  Coedge3_HC = 80,
58  Coedge5_HC = 110,
59  Coedge3_HG = 86,
60  Coedge4_HG = 102,
61  Coedge4_EH = 94,
62  Coedge5_EH = 108,
63  Loop0_ABCD = 7,
64  Loop1_ABFE = 35,
65  Loop2_FBDG = 57,
66  Loop3_GDCH = 75,
67  Loop4_EFGH = 93,
68  Loop5_EHCA = 107,
69  FaceABCD = 5,
70  FaceABFE = 33,
71  FaceFBDG = 55,
72  FaceGDCH = 73,
73  FaceEFGH = 91,
74  FaceEHCA = 105,
75  };

Function Documentation

◆ CreateAxis()

Dtk_BodyPtr sampleWriter::CreateAxis ( )
1556  {
1557  Dtk_BodyPtr mybody = Dtk_Body::Create();
1558  Dtk_ShellPtr shell = Dtk_Shell::Create( mybody );
1559  Dtk_tab<Dtk_CurvePtr> CurveArray;
1560 
1561  mybody->info() = Dtk_Info::create();
1562  mybody->get_info()->SetInfiniteGeometryFlag( DTK_TRUE );
1563  mybody->get_info()->SetRefEntityFlag( DTK_TRUE );
1564 
1565 
1566  Dtk_LinePtr lineptr = Dtk_Line::Create( Dtk_pnt( -41, -42, -50 ), Dtk_pnt( -51, -52, -50 ) );
1567  lineptr->info() = Dtk_Info::create();
1568  lineptr->info()->SetColor( Dtk_RGB( 0, 255, 25, 255 ) );
1569  lineptr->info()->SetName( L"myaxe" );
1570 
1571 
1572  Dtk_MetaDataPtr metadata = Dtk_MetaData::CreateMetaData( Dtk_MetaData::TypeProperty, L"Title of myaxe", L"Value of myaxe" );
1573  Dtk_tab<Dtk_MetaDataPtr> ArrayMetadataEntity;
1574  ArrayMetadataEntity.push_back( metadata );
1575  lineptr->info()->SetMetaData( ArrayMetadataEntity );
1576 
1577  CurveArray.push_back( Dtk_CurvePtr::DtkDynamicCast( lineptr ) );
1578 
1579  shell->AddWire( CurveArray );
1580  mybody->AddWireShell( shell );
1581 
1582  return mybody;
1583  }

◆ CreateAxisSystem()

Dtk_AxisSystemPtr sampleWriter::CreateAxisSystem ( )
1530  {
1532  Dtk_transfo dtk_transfo;
1533  dtk_transfo.setXdir( 0.0, 0.0, 1.0 );
1534  dtk_transfo.setYdir( -1.0, 0.0, 0.0 );
1535  dtk_transfo.setZdir( 0.0, -1.0, 0.0 );
1536  dtk_transfo.setOrigin( Dtk_pnt( -41, -42, -50 ) );
1537  mycsystem->SetMatrix( dtk_transfo );
1538  mycsystem->info() = Dtk_Info::create();
1539  mycsystem->info()->SetName( L"mycsystem" );
1540  mycsystem->info()->SetColor( Dtk_RGB( 255, 0, 0, 255 ) );
1541  mycsystem->info()->SetLayer( 123 );
1542 
1543 
1544  Dtk_MetaDataPtr metadata = Dtk_MetaData::CreateMetaData( Dtk_MetaData::TypeProperty, L"Title of mycsystem", L"Value of mycsystem" );
1545  Dtk_tab<Dtk_MetaDataPtr> ArrayMetadataEntity;
1546  ArrayMetadataEntity.push_back( metadata );
1547  mycsystem->info()->SetMetaData( ArrayMetadataEntity );
1548 
1549  //Uncomment to put the AxisSystem as Blanked
1550  //mycsystem->info()->SetBlankedStatus(DTK_TRUE);
1551 
1552  return mycsystem;
1553  }

◆ CreateConstructionPlane()

Dtk_BodyPtr sampleWriter::CreateConstructionPlane ( )
1162  {
1163  Dtk_BodyPtr body = Dtk_Body::Create();
1164  Dtk_PlaneSurfacePtr plan = Dtk_PlaneSurface::Create( Dtk_pnt( 0., 50., 0. ), Dtk_dir( 0., 1., 0. ), Dtk_dir( 1., 0., 0. ) );
1165  Dtk_FacePtr face = Dtk_Face::Create( body );
1166  face->SetGeom( Dtk_SurfacePtr::DtkDynamicCast( plan ) );
1167  Dtk_ShellPtr shell = Dtk_Shell::Create( body );
1168  shell->AddFace( face, DTK_TRUE );
1169  body->AddOpenShell( shell );
1170  body->info() = Dtk_Info::create();
1171  body->info()->SetName( "Plane Y=50" );
1172  return body;
1173  }

◆ CreateCube()

Dtk_BodyPtr sampleWriter::CreateCube ( )
1321  {
1322  std::map<Dtk_ID, Dtk_EntityPtr> array_topo;
1323 
1324  Dtk_BodyPtr body = Dtk_Body::Create(); // create the Body
1325  body->info() = Dtk_Info::create();
1326  body->info()->SetName( L"Body" );
1327 
1328  Dtk_MetaDataPtr metadata = Dtk_MetaData::CreateMetaData( Dtk_MetaData::TypeProperty, L"Title of Body", L"Value of Body" );
1329  Dtk_tab<Dtk_MetaDataPtr> ArrayMetadataEntity;
1330  ArrayMetadataEntity.push_back( metadata );
1331  body->info()->SetMetaData( ArrayMetadataEntity );
1332 
1333  CreateTopoVertex( array_topo, body ); //create all Vertex
1334  CreateTopoEdge( array_topo, body ); //create all Edge
1335  CreateTopoCoEdge( array_topo, body );//create all Coedge
1336  CreateTopoLoop( array_topo, body );//create all Loop
1337  CreateTopoFace( array_topo, body );//create all Face
1338  CreateTopoShell( array_topo, body );//create all Shell
1339  CreateTopoVolume( array_topo, body );//create all Volume
1340  CreateTopoLump( array_topo, body );//create all Lump
1341 
1342  body->AddLump( Dtk_LumpPtr::DtkDynamicCast( array_topo[ Lump ] ) ); // add the Lump into the body.
1343 
1344  return body;
1345  }

◆ CreateCube_2()

Dtk_BodyPtr sampleWriter::CreateCube_2 ( )
1071  {
1072  std::map<Dtk_ID, Dtk_EntityPtr> array_topo;
1073 
1074  Dtk_BodyPtr body = Dtk_Body::Create(); // create the Body
1075 
1076  CreateTopoVertex_2( array_topo, body ); //create all Vertex
1077  CreateTopoEdge_2( array_topo, body ); //create all Edge
1078  CreateTopoCoEdge_2( array_topo, body );//create all Coedge
1079  CreateTopoLoop_2( array_topo, body );//create all Loop
1080  CreateTopoFace_2( array_topo, body );//create all Face
1081  CreateTopoShell_2( array_topo, body );//create all Shell
1082  CreateTopoVolume_2( array_topo, body );//create all Volume
1083  CreateTopoLump_2( array_topo, body );//create all Lump
1084 
1085  body->AddLump( Dtk_LumpPtr::DtkDynamicCast( array_topo[ 1 ] ) ); // add the Lump into the body.
1086 
1087  // V78 : val prop sur Body : IGNORED
1088  Dtk_InfoPtr& body_info = body->info();
1089  if( body_info.IsNULL() ) body_info = Dtk_Info::create();
1090  Dtk_Val valprop_area( "1234 mm2" );
1091  body_info->AddAttribute( "geometric validation property : : surface area measure", valprop_area );
1092  Dtk_Val valprop_volume( "5678 mm3" );
1093  body_info->AddAttribute( "geometric validation property : : volume measure", valprop_volume );
1094  Dtk_Val valprop_CG( Dtk_pnt( 12., 34., 56. ) );
1095  body_info->AddAttribute( "geometric validation property : : centre point", valprop_CG );
1096 
1097  return body;
1098  }

◆ CreateCubeRenderInfos()

Dtk_RenderInfosPtr sampleWriter::CreateCubeRenderInfos ( )
501  {
502  //Variables
503  Dtk_RGB ambiant;
504  Dtk_RGB diffuse;
505  Dtk_RGB specular;
506  Dtk_LightMapPtr lightMap;
507  Dtk_TextureInfosPtr texture;
508  Dtk_string fileName;
509 
510  //Creating lighting
511  ambiant.SetRGBA( 255, 255, 255 );
512  diffuse.SetRGBA( 255, 255, 255 );
513  specular.SetRGBA( 255, 255, 255 );
514  lightMap = Dtk_LightMap::Create( ambiant, diffuse, specular );
515 
516  //Creating texture using cubical mapping
518  //Setting image to the texture
519  fileName = "..\\InputImages\\sample.bmp";
520  texture->SetImagePath( fileName );
521  //Scaling the texture
522  texture->SetScale( 2, 2 );
523 
524  //Finally creating render informations
525  Dtk_RenderInfosPtr renderInfo = Dtk_RenderInfos::Create( "Rendering", lightMap, texture );
526 
527  return renderInfo;
528  }

◆ CreateCurves()

Dtk_BodyPtr sampleWriter::CreateCurves ( )
1362  {
1363  Dtk_tab<Dtk_CurvePtr> mycurves;
1364  Dtk_BodyPtr mybody;
1365  mybody = Dtk_Body::Create();
1366  Dtk_ShellPtr myshell;
1367  myshell = Dtk_Shell::Create( mybody );
1368 
1369  Dtk_EllipsePtr myellipse;
1370 
1371  //add circle curve
1372  myellipse = Dtk_Ellipse::Create( Dtk_pnt( 0.0, 0.0, 0.0 ), Dtk_dir( 0.0, 0.0, 1.0 ), Dtk_dir( 1.0, 0.0, 0.0 ), 10.0 );
1373  Dtk_CurvePtr mycurve;
1374  mycurve = Dtk_CurvePtr::DtkDynamicCast( myellipse );
1375  mycurve->info() = Dtk_Info::create();
1376  mycurve->info()->SetColor( Dtk_RGB( 255, 0, 255 ) );
1377  mycurve->info()->SetName( "mycircle" );
1378  mycurves.push_back( mycurve );
1379 
1380 
1381  //add ellipse curve
1382  myellipse = Dtk_Ellipse::Create( Dtk_pnt( 0.0, 0.0, 0.0 ), Dtk_dir( 0.0, 0.0, 1.0 ), Dtk_dir( 1.0, 0.0, 0.0 ), 10.0, 5.0 );
1383  mycurve = Dtk_CurvePtr::DtkDynamicCast( myellipse );
1384  mycurve->info() = Dtk_Info::create();
1385  mycurve->info()->SetColor( Dtk_RGB( 255, 255, 0 ) );
1386  mycurve->info()->SetName( "myellipse" );
1387  mycurves.push_back( mycurve );
1388 
1389 
1390  //add line curve
1391  Dtk_LinePtr myline;
1392  myline = Dtk_Line::Create( Dtk_pnt( -5.0, 0.0, 0.0 ), Dtk_pnt( 5.0, 0.0, 0.0 ) );
1393  mycurve = Dtk_CurvePtr::DtkDynamicCast( myline );
1394  mycurve->info() = Dtk_Info::create();
1395  mycurve->info()->SetColor( Dtk_RGB( 0, 0, 255 ) );
1396  mycurve->info()->SetName( "myline" );
1397  mycurves.push_back( mycurve );
1398 
1399 
1400  //add nurbs curve
1401  //nurbs with 4 Control Points
1402  //respect num_points = Knots.size() - Degree - 1;
1403  Dtk_tab<Dtk_pnt> ControlPoints;
1404  Dtk_tab<Dtk_Double64> Knots;
1405  Dtk_Int32 Degree = 3;
1406  ControlPoints.resize( 4 );
1407  ControlPoints[ 0 ] = Dtk_pnt( -5.0, 0.0, 0.0 );
1408  ControlPoints[ 1 ] = Dtk_pnt( -2.0, 5.0, 0. );
1409  ControlPoints[ 2 ] = Dtk_pnt( 2.0, -5.0, 0. );
1410  ControlPoints[ 3 ] = Dtk_pnt( 5.0, 0.0, 0. );
1411  Knots.resize( 8 );
1412  Knots[ 0 ] = Knots[ 1 ] = Knots[ 2 ] = Knots[ 3 ] = 0.0;
1413  Knots[ 4 ] = Knots[ 5 ] = Knots[ 6 ] = Knots[ 7 ] = 1.0;
1414 
1415  Dtk_NurbsCurvePtr cnurbs = Dtk_NurbsCurve::Create( Degree, Knots, ControlPoints );
1416  mycurve = Dtk_CurvePtr::DtkDynamicCast( cnurbs );
1417  mycurve->info() = Dtk_Info::create();
1418  mycurve->info()->SetColor( Dtk_RGB( 0, 255, 0 ) );
1419  mycurve->info()->SetName( "mynurbs" );
1420  mycurves.push_back( mycurve );
1421 
1422 
1423 
1424  myshell->AddWire( mycurves );
1425  mybody->AddWireShell( myshell );
1426 
1427 
1428  Dtk_MetaDataPtr metadata = Dtk_MetaData::CreateMetaData( Dtk_MetaData::TypeProperty, L"Title of mycurve", L"Value of mycurve" );
1429  Dtk_tab<Dtk_MetaDataPtr> ArrayMetadataEntity;
1430  ArrayMetadataEntity.push_back( metadata );
1431 
1432  mybody->info() = Dtk_Info::create();
1433  mybody->info()->SetMetaData( ArrayMetadataEntity );
1434 
1435  return mybody;
1436  }

◆ CreateCurves_2()

Dtk_BodyPtr sampleWriter::CreateCurves_2 ( )
1115  {
1116  Dtk_tab<Dtk_CurvePtr> mycurves;
1117  Dtk_BodyPtr mysbody;
1118  mysbody = Dtk_Body::Create();
1119 
1120  Dtk_ShellPtr myshell;
1121  myshell = Dtk_Shell::Create( mysbody );
1122 
1123  Dtk_EllipsePtr myellipse;
1124  myellipse = Dtk_Ellipse::Create( Dtk_pnt( 0.0, 0.0, 0.0 ), Dtk_dir( 0.0, 0.0, 1.0 ), Dtk_dir( 1.0, 0.0, 0.0 ), 10.0 );
1125 
1126  Dtk_CurvePtr mycurve;
1127  mycurve = Dtk_CurvePtr::DtkDynamicCast( myellipse );
1128 
1129  mycurve->info() = Dtk_Info::create();
1130  mycurve->info()->SetColor( Dtk_RGB( 255, 0, 255 ) );
1131  mycurve->info()->SetName( "mycircle" );
1132 
1133  mycurves.push_back( mycurve );
1134 
1135  Dtk_LinePtr myline;
1136  myline = Dtk_Line::Create( Dtk_pnt( -5.0, 0.0, 0.0 ), Dtk_pnt( 5.0, 0.0, 0.0 ) );
1137  mycurve = Dtk_CurvePtr::DtkDynamicCast( myline );
1138 
1139  mycurve->info() = Dtk_Info::create();
1140  mycurve->info()->SetColor( Dtk_RGB( 0, 0, 255 ) );
1141  mycurve->info()->SetName( "myline" );
1142 
1143  mycurves.push_back( mycurve );
1144 
1145  myshell->AddWire( mycurves );
1146  mysbody->AddWireShell( myshell );
1147 
1148  // Val Prop on Body : not yet supported
1149  Dtk_InfoPtr& body_info = mysbody->info();
1150  if( body_info.IsNULL() ) body_info = Dtk_Info::create();
1151  Dtk_Val valprop_curve_length( "1234 mm" );
1152  body_info->AddAttribute( "geometric validation property : : curve length measure", valprop_curve_length );
1153 
1154  return mysbody;
1155  }

◆ CreateCurvesStyle()

Dtk_BodyPtr sampleWriter::CreateCurvesStyle ( )
1439  {
1440  Dtk_tab<Dtk_CurvePtr> mycurves;
1441  Dtk_BodyPtr mybody;
1442  mybody = Dtk_Body::Create();
1443  Dtk_ShellPtr myshell;
1444  myshell = Dtk_Shell::Create( mybody );
1445 
1446  Dtk_EllipsePtr ellipsethick = Dtk_Ellipse::Create( Dtk_pnt( 0.0, 0.0, 5.0 ), Dtk_dir( 0.0, 0.0, 1.0 ), Dtk_dir( 1.0, 0.0, 0.0 ), 10.0 );
1447  ellipsethick->info() = Dtk_Info::create();
1448  ellipsethick->info()->SetColor( Dtk_RGB( 255, 0, 0 ) );
1449  ellipsethick->info()->SetCurveThickNessInMM( 4 );
1450  mycurves.push_back( Dtk_CurvePtr::DtkDynamicCast( ellipsethick ) );
1451 
1452 
1453  Dtk_EllipsePtr ellipsedash = Dtk_Ellipse::Create( Dtk_pnt( 0.0, 0.0, 6.0 ), Dtk_dir( 0.0, 0.0, 1.0 ), Dtk_dir( 1.0, 0.0, 0.0 ), 10.0 );
1454  ellipsedash->info() = Dtk_Info::create();
1455  ellipsedash->info()->SetColor( Dtk_RGB( 0, 0, 255 ) );
1456  ellipsedash->info()->SetCurveLineType( DTK_DASHED );
1457  mycurves.push_back( Dtk_CurvePtr::DtkDynamicCast( ellipsedash ) );
1458 
1459  Dtk_EllipsePtr ellipsedotted = Dtk_Ellipse::Create( Dtk_pnt( 0.0, 0.0, 7.0 ), Dtk_dir( 0.0, 0.0, 1.0 ), Dtk_dir( 1.0, 0.0, 0.0 ), 10.0 );
1460  ellipsedotted->info() = Dtk_Info::create();
1461  ellipsedotted->info()->SetColor( Dtk_RGB( 255, 0, 255 ) );
1462  ellipsedotted->info()->SetCurveLineType( DTK_DOTTED );
1463  ellipsedotted->info()->SetCurveThickNessInMM( 2 );
1464  mycurves.push_back( Dtk_CurvePtr::DtkDynamicCast( ellipsedotted ) );
1465 
1466  myshell->AddWire( mycurves );
1467  mybody->AddWireShell( myshell );
1468  mybody->info() = Dtk_Info::create();
1469 
1470  return mybody;
1471  }

◆ CreateCyl()

Dtk_BodyPtr sampleWriter::CreateCyl ( double  radius,
double  height 
)
1755  {
1756  Dtk_BodyPtr body = Dtk_Body::Create();
1757  Dtk_LumpPtr lump = Dtk_Lump::Create( body );
1758  Dtk_VolumePtr volume = Dtk_Volume::Create( body );
1759  Dtk_ShellPtr shell = Dtk_Shell::Create( body );
1760  body->AddLump( lump );
1761  lump->AddVolume( volume );
1762  volume->AddOuterShell( shell );
1763 
1764  Dtk_pnt P[ 4 ];
1765  P[ 0 ] = Dtk_pnt( radius, 0, 0 );
1766  P[ 1 ] = Dtk_pnt( radius, 0, height );
1767  P[ 2 ] = Dtk_pnt( -radius, 0, height );
1768  P[ 3 ] = Dtk_pnt( -radius, 0, 0 );
1769  Dtk_VertexPtr v[ 4 ];
1770  Dtk_Size_t i;
1771  for( i = 0; i < 4; i++ )
1772  v[ i ] = MakeVertex( body, P[ i ] );
1773  Dtk_EdgePtr e[ 6 ];
1774  e[ 0 ] = MakeEdge( body, v[ 0 ], v[ 1 ], MakeSegment( P[ 0 ], P[ 1 ] ), 1 );
1775  e[ 1 ] = MakeEdge( body, v[ 2 ], v[ 3 ], MakeSegment( P[ 2 ], P[ 3 ] ), 2 );
1776  e[ 2 ] = MakeEdge( body, v[ 3 ], v[ 0 ], MakeArc2D( Dtk_pnt(), radius, -DTK_PI, 0 ), 3 );
1777  e[ 3 ] = MakeEdge( body, v[ 0 ], v[ 3 ], MakeArc2D( Dtk_pnt(), radius, 0, DTK_PI ), 4 );
1778  e[ 4 ] = MakeEdge( body, v[ 2 ], v[ 1 ], MakeArc2D( Dtk_pnt( 0, 0, height ), radius, -DTK_PI, 0 ), 5 );
1779  e[ 5 ] = MakeEdge( body, v[ 1 ], v[ 2 ], MakeArc2D( Dtk_pnt( 0, 0, height ), radius, 0, DTK_PI ), 6 );
1780 
1781  Dtk_FacePtr half1 = MakeOuterFace( body, MakeCyl( Dtk_pnt(), radius, height ),
1782  MakeCoedge( body, e[ 0 ], DTK_TRUE, MakeSegment2D( 0, 0, 0, height ) ),
1783  MakeCoedge( body, e[ 4 ], DTK_FALSE, MakeSegment2D( 0, height, -DTK_PI, height ) ),
1784  MakeCoedge( body, e[ 1 ], DTK_TRUE, MakeSegment2D( -DTK_PI, height, -DTK_PI, 0 ) ),
1785  MakeCoedge( body, e[ 2 ], DTK_TRUE, MakeSegment2D( -DTK_PI, 0, 0, 0 ) )
1786  );
1787  shell->AddFace( half1, DTK_TRUE );
1788  FillInfos( half1->info(), 1, Dtk_RGB() );
1789 
1790  Dtk_FacePtr half2 = MakeOuterFace( body, MakeCyl( Dtk_pnt(), radius, height ),
1791  MakeCoedge( body, e[ 3 ], DTK_TRUE, MakeSegment2D( 0, 0, DTK_PI, 0 ) ),
1792  MakeCoedge( body, e[ 1 ], DTK_FALSE, MakeSegment2D( DTK_PI, 0, DTK_PI, height ) ),
1793  MakeCoedge( body, e[ 5 ], DTK_FALSE, MakeSegment2D( DTK_PI, height, 0, height ) ),
1794  MakeCoedge( body, e[ 0 ], DTK_FALSE, MakeSegment2D( 0, height, 0, 0 ) )
1795  );
1796  shell->AddFace( half2, DTK_TRUE );
1797  FillInfos( half2->info(), 2, Dtk_RGB() );
1798 
1799  Dtk_FacePtr plandown = MakeOuterFace( body, MakePlane( Dtk_pnt(), Dtk_dir( 0, 0, -1 ), radius ),
1800  MakeCoedge( body, e[ 2 ], DTK_FALSE, MakeArc2D( Dtk_pnt(), radius, 0, DTK_PI ) ),
1801  MakeCoedge( body, e[ 3 ], DTK_FALSE, MakeArc2D( Dtk_pnt(), radius, DTK_PI, 2 * DTK_PI ) ),
1802  NULL, NULL
1803  );
1804  shell->AddFace( plandown, DTK_TRUE );
1805  FillInfos( plandown->info(), 3, Dtk_RGB() );
1806 
1807  Dtk_FacePtr planup = MakeOuterFace( body, MakePlane( Dtk_pnt( 0, 0, height ), Dtk_dir( 0, 0, 1 ), radius ),
1808  MakeCoedge( body, e[ 4 ], DTK_TRUE, MakeArc2D( Dtk_pnt(), radius, -DTK_PI, 0 ) ),
1809  MakeCoedge( body, e[ 5 ], DTK_TRUE, MakeArc2D( Dtk_pnt(), radius, 0, DTK_PI ) ),
1810  NULL, NULL
1811  );
1812  shell->AddFace( planup, DTK_TRUE );
1813  FillInfos( planup->info(), 4, Dtk_RGB( 0, 255, 0 ) );
1814  body->info() = Dtk_Info::create();
1815 
1816  return body;
1817  }

◆ CreateCylinder()

Dtk_BodyPtr sampleWriter::CreateCylinder ( )
1186  {
1187  Dtk_BodyPtr mysbody;
1188  mysbody = Dtk_Body::Create();
1189 
1190  // Curves of edges
1191  Dtk_PointPtr P1 = Dtk_Point::Create( 50., 0., 100. );
1192  Dtk_PointPtr P2 = Dtk_Point::Create( 50., 0., 0. );
1193  Dtk_pnt cent1( 0., 0., 100. );
1194  Dtk_EllipsePtr circ1 = Dtk_Ellipse::Create( cent1, Dtk_dir( 0., 0., 1. ), Dtk_dir( 1., 0., 0. ), 50. );
1195  Dtk_pnt cent2( 0., 0., 0. );
1196  Dtk_EllipsePtr circ2 = Dtk_Ellipse::Create( cent2, Dtk_dir( 0., 0., 1. ), Dtk_dir( 1., 0., 0. ), 50. );
1197  Dtk_LinePtr seam = Dtk_Line::Create( Dtk_pnt( 50., 0., 0. ), Dtk_pnt( 50., 0., 100. ) );
1198  // Surfaces of faces
1199  // Notice : for tessellation, it is required to record the UV trim in surfaces
1200  double trim[ 4 ];
1201  Dtk_PlaneSurfacePtr plan1 = Dtk_PlaneSurface::Create( cent1, Dtk_dir( 0., 0., 1. ), Dtk_dir( 1., 0., 0. ) );
1202  trim[ 0 ] = -100.; trim[ 1 ] = 100.; trim[ 2 ] = -100.; trim[ 3 ] = 100.;
1203  plan1->SetTrimUVBox( trim );
1204  Dtk_PlaneSurfacePtr plan2 = Dtk_PlaneSurface::Create( cent2, Dtk_dir( 0., 0., 1. ), Dtk_dir( 1., 0., 0. ) );
1205  plan2->SetTrimUVBox( trim );
1206  Dtk_CylindricalSurfacePtr cylsurf = Dtk_CylindricalSurface::Create( cent2, Dtk_dir( 0., 0., 1. ), Dtk_dir( 1., 0., 0. ), 50 );
1207  trim[ 0 ] = 0.; trim[ 1 ] = 2. * DTK_PI;
1208  cylsurf->SetTrimUVBox( trim );
1209 
1210  // Topology
1211  // Vertices
1212  Dtk_VertexPtr V1 = Dtk_Vertex::Create( mysbody );
1213  V1->SetGeom( P1 );
1214  Dtk_VertexPtr V2 = Dtk_Vertex::Create( mysbody );
1215  V2->SetGeom( P2 );
1216  // Edges
1217  Dtk_EdgePtr E0 = Dtk_Edge::Create( mysbody );
1218  E0->SetGeom( Dtk_CurvePtr::DtkDynamicCast( seam ) );
1219  E0->SetStartVertex( V1 );
1220  E0->SetEndVertex( V2 );
1221  Dtk_EdgePtr E1 = Dtk_Edge::Create( mysbody );
1222  E1->SetGeom( Dtk_CurvePtr::DtkDynamicCast( circ1 ) );
1223  E1->SetStartVertex( V1 );
1224  E1->SetEndVertex( V1 );
1225  Dtk_EdgePtr E2 = Dtk_Edge::Create( mysbody );
1226  E2->SetGeom( Dtk_CurvePtr::DtkDynamicCast( circ2 ) );
1227  E2->SetStartVertex( V2 );
1228  E2->SetEndVertex( V2 );
1229 
1230  // Faces
1231  Dtk_FacePtr F0 = Dtk_Face::Create( mysbody );
1232  F0->SetGeom( Dtk_SurfacePtr::DtkDynamicCast( cylsurf ) );
1233  SetTopoFaceID( F0, 10 );
1234  Dtk_FacePtr F1 = Dtk_Face::Create( mysbody );
1235  F1->SetGeom( Dtk_SurfacePtr::DtkDynamicCast( plan1 ) );
1236  SetTopoFaceID( F1, 20 );
1237  // test for face color different from body color
1238  F1->info()->SetColor( Dtk_RGB( 255, 0, 0 ) ); // info created by SetTopoFaceID
1239  Dtk_FacePtr F2 = Dtk_Face::Create( mysbody );
1240  F2->SetGeom( Dtk_SurfacePtr::DtkDynamicCast( plan2 ) );
1241  SetTopoFaceID( F2, 30 );
1242  // Loops + coedges
1243  Dtk_LoopPtr L0 = Dtk_Loop::Create( mysbody );
1244  Dtk_CoedgePtr C01 = Dtk_Coedge::Create( mysbody );
1245  C01->SetEdge( E1 );
1246  L0->AddCoedge( C01, DTK_FALSE );
1247  Dtk_CoedgePtr C02 = Dtk_Coedge::Create( mysbody );
1248  C02->SetEdge( E0 );
1249  L0->AddCoedge( C02, DTK_FALSE );
1250  Dtk_CoedgePtr C03 = Dtk_Coedge::Create( mysbody );
1251  C03->SetEdge( E2 );
1252  L0->AddCoedge( C03, DTK_TRUE );
1253  Dtk_CoedgePtr C04 = Dtk_Coedge::Create( mysbody );
1254  C04->SetEdge( E0 );
1255  L0->AddCoedge( C04, DTK_TRUE );
1256  F0->AddOuterLoop( L0 );
1257 
1258  Dtk_LoopPtr L1 = Dtk_Loop::Create( mysbody );
1259  Dtk_CoedgePtr C1 = Dtk_Coedge::Create( mysbody );
1260  C1->SetEdge( E1 );
1261  L1->AddCoedge( C1, DTK_TRUE );
1262  F1->AddOuterLoop( L1 );
1263 
1264  Dtk_LoopPtr L2 = Dtk_Loop::Create( mysbody );
1265  Dtk_CoedgePtr C2 = Dtk_Coedge::Create( mysbody );
1266  C2->SetEdge( E2 );
1267  L2->AddCoedge( C2, DTK_TRUE );
1268  F2->AddOuterLoop( L2 );
1269 
1270  // Shell, Volume
1271  Dtk_ShellPtr SH = Dtk_Shell::Create( mysbody );
1272  SH->AddFace( F0, DTK_TRUE );
1273  SH->AddFace( F1, DTK_TRUE );
1274  SH->AddFace( F2, DTK_FALSE );
1275  Dtk_VolumePtr VOL = Dtk_Volume::Create( mysbody );
1276  VOL->AddOuterShell( SH );
1277  Dtk_LumpPtr Lump = Dtk_Lump::Create( mysbody );
1278  Lump->AddVolume( VOL );
1279  mysbody->AddLump( Lump );
1280  if( mysbody->info().IsNULL() ) mysbody->info() = Dtk_Info::create();
1281  mysbody->info()->SetColor( Dtk_RGB( 0, 255, 0 ) );//Whole body color
1282 
1283  return mysbody;
1284  }

◆ CreateDimension()

Dtk_FdtPtr sampleWriter::CreateDimension ( )
117  {
118  Dtk_FdtPtr fdt = Dtk_Fdt::Create();
119 
121 
122 
123  // Creation of Text info
124  Dtk_InfoPtr text_info = Dtk_Info::create();
125 
126  //Setting text style
127  Dtk_bool horiz_vert = 0, mirror = 0, font_index = 0;
128  double slant = 0.;
129  Dtk_TextStyle text_style;
130  //Text height
131  text_style.CharHeight() = 3.5;
132  //Text width
133  text_style.CharWidth() = 2.1;
134  //Text slant
135  text_style.Slant() = slant;
136 
137  //Creating text value "200"
138  Dtk_string str( "200" );
139  //Creating text 2D Bounding box
140  Dtk_pnt location( -5., 20. );
141  double x_len = 15., y_len = 5.;
142  Dtk_dir x_dir( 1., 0., 0. ), y_dir( 0., 0., 1. );
143  Dtk_Oriented2dBBox inbox( location, x_len, y_len, x_dir, y_dir );
144 
147 
148  //Creating the text itself giving :
149  // - its value
150  // - inside and outside boxes
151  // - anchor type
152  // - text type
153  // - horizontal/vertical text orientation
154  // - text infos
155  // - text style
156  // - text slant - PI / 2.0 for normal text -
157  // - font index
158  // - mirroring type
159  Dtk_Text dtk_text( str, inbox, inbox, dtk_align, text_type, horiz_vert, text_info, text_style, slant, font_index, mirror );
160  Dtk_CompositeText texts;
161  texts.AddText( dtk_text );
162 
163  //Creating the Dimension itself
165  Dtk_DimensionPtr dimension = Dtk_Dimension::Create( dimensionType, texts );
166  //Adding dimension to FDT
167  fdt->Sub2DEntity() = Dtk_2dEntityPtr::DtkDynamicCast( dimension );
168 
169  //Creating the Leader lines
170  //Setting leader terminator type
172  //Setting leader terminator size
173  double arrow_width = 5., arrow_length = 5.;
174  //Creating first leader
175  //Setting the Arrow location
176  Dtk_pnt leader1_arrow_location = Dtk_pnt( 100., 23., 0. );
177  //Setting the leader position
178  Dtk_transfo leader1_pos;
179  leader1_pos.setOrigin( Dtk_pnt( 0., 23., 0. ) );
180  //Setting the leader points
181  Dtk_tab<Dtk_pnt> leader1_pts;
182  leader1_pts.push_back( Dtk_pnt( 10., 23., 0. ) );
183  //Creating the first leader itself
184  Dtk_LeaderPtr leader1 = Dtk_Leader::Create( arrow_width, arrow_length, leader1_arrow_location, termintator_type, leader1_pts );
185  //Adding extension lines
186  Dtk_tab<Dtk_pnt> extension_line_1;
187  extension_line_1.push_back( Dtk_pnt( 100., 25. ) );
188  extension_line_1.push_back( Dtk_pnt( 100., 0. ) );
189  leader1->SetExtensionLine( Dtk_Polyline::Create( std::move( extension_line_1 ) ) );
190  dimension->AddLeader( leader1 );
191 
192  //Creating second leader
193  Dtk_transfo leader2_pos;
194  leader2_pos.setOrigin( Dtk_pnt( 0., 23., 0. ) );
195  Dtk_tab<Dtk_pnt> leader2_pts;
196  //Setting the Arrow location
197  Dtk_pnt leader2_arrow_location = Dtk_pnt( -100., 23., 0. );
198  leader2_pts.push_back( Dtk_pnt( -10., 23., 0. ) );
199  //Creating the second leader itself
200  Dtk_LeaderPtr leader2 = Dtk_Leader::Create( arrow_width, arrow_length, leader2_arrow_location, termintator_type, leader2_pts );
201  //Adding extension lines
202  Dtk_tab<Dtk_pnt> extension_line_2;
203  extension_line_2.push_back( Dtk_pnt( -100., 25. ) );
204  extension_line_2.push_back( Dtk_pnt( -100., 0. ) );
205  leader2->SetExtensionLine( Dtk_Polyline::Create( std::move( extension_line_2 ) ) );
206  dimension->AddLeader( leader2 );
207 
208  // General data of the FDT : position, color, name ..
209  Dtk_transfo fdt_transf;
210  fdt_transf.setOrigin( Dtk_pnt( 0., 200., 75. ) );
211  fdt_transf.setXdir( 0., 1., 0. );
212  fdt_transf.setYdir( -1., 0., 0. );
213  fdt->Transform( fdt_transf );
214 
215  Dtk_InfoPtr fdt_info = Dtk_Info::create();
216  fdt_info->SetColor( 0, 255, 0 );
217  fdt_info->SetName( "Dimension:1" );
218  fdt->info() = fdt_info;
219 
220  Dtk_MetaDataPtr metadata = Dtk_MetaData::CreateMetaData( Dtk_MetaData::TypeProperty, L"Title of myfdt", L"Value of myfdt" );
221  Dtk_tab<Dtk_MetaDataPtr> ArrayMetadataEntity;
222  ArrayMetadataEntity.push_back( metadata );
223  fdt->info()->SetMetaData( ArrayMetadataEntity );
224 
225  return fdt;
226  }

◆ CreateEsquisse2D()

Dtk_BodyPtr sampleWriter::CreateEsquisse2D ( )
1685  {
1686  Dtk_tab<Dtk_CurvePtr> ArrayCurve;
1687  Dtk_tab<Dtk_PointPtr> ArrayPoint;
1688 
1689  Dtk_PointPtr mypoint;
1690  mypoint = Dtk_Point::Create( Dtk_pnt( 1.0, 2.0, 0.0 ) );
1691  ArrayPoint.push_back( mypoint );
1692 
1693  Dtk_LinePtr line = Dtk_Line::Create( Dtk_pnt( 0.000000, 0.0, 0.0 ), Dtk_pnt( 1.0, 0.0, 0.0 ) );
1694  ArrayCurve.push_back( Dtk_CurvePtr::DtkDynamicCast( line ) );
1695  line = Dtk_Line::Create( Dtk_pnt( 1.0, 1.0, 0.0 ), Dtk_pnt( 0.0, 1.0, 0.0 ) );
1696  ArrayCurve.push_back( Dtk_CurvePtr::DtkDynamicCast( line ) );
1697 
1698  Dtk_EllipsePtr myarccircle;
1699  myarccircle = Dtk_Ellipse::Create( Dtk_pnt( 1.0, 0.5, 0.0 ), Dtk_dir( 0.0, 0.0, 1.0 ), Dtk_dir( 1.0, 0.0, 0.0 ), 0.5, 0.5 );
1700  myarccircle->SetTrimmingParameters( -1.0 * DTK_PI / 2.0, DTK_PI / 2.0 );
1701  ArrayCurve.push_back( Dtk_CurvePtr::DtkDynamicCast( myarccircle ) );
1702 
1703  myarccircle = Dtk_Ellipse::Create( Dtk_pnt( 0.0, 0.5, 0.0 ), Dtk_dir( 0.0, 0.0, 1.0 ), Dtk_dir( 1.0, 0.0, 0.0 ), 0.5, 0.5 );
1704  myarccircle->SetTrimmingParameters( DTK_PI / 2.0, 3.0 * DTK_PI / 2.0 );
1705  Dtk_NurbsCurvePtr nurbs = myarccircle->ToNurbs();
1706  ArrayCurve.push_back( Dtk_CurvePtr::DtkDynamicCast( nurbs ) );
1707 
1708  Dtk_EllipsePtr mycircle;
1709  mycircle = Dtk_Ellipse::Create( Dtk_pnt( -0.125, 0.5, 0.0 ), Dtk_dir( 0.0, 0.0, 1.0 ), Dtk_dir( 1.0, 0.0, 0.0 ), 0.25 );
1710  ArrayCurve.push_back( Dtk_CurvePtr::DtkDynamicCast( mycircle ) );
1711 
1712  Dtk_EllipsePtr myellipse;
1713  myellipse = Dtk_Ellipse::Create( Dtk_pnt( 0.5, 0.25, 0.0 ), Dtk_dir( 0.0, 0.0, 1.0 ), Dtk_dir( 1.0, 0.0, 0.0 ), 0.25, 0.1 );
1714  ArrayCurve.push_back( Dtk_CurvePtr::DtkDynamicCast( myellipse ) );
1715 
1716  Dtk_EllipsePtr myarcellipse;
1717  myarcellipse = Dtk_Ellipse::Create( Dtk_pnt( 0.5, 0.75, 0.0 ), Dtk_dir( 0.0, 0.0, 1.0 ), Dtk_dir( 1.0, 0.0, 0.0 ), 0.25, 0.1 );
1718  myarcellipse->SetTrimmingParameters( -1.0 * DTK_PI / 2.0, DTK_PI / 2.0 );
1719  ArrayCurve.push_back( Dtk_CurvePtr::DtkDynamicCast( myarcellipse ) );
1720 
1721  myarcellipse = Dtk_Ellipse::Create( Dtk_pnt( 0.5, 0.75, 0.0 ), Dtk_dir( 0.0, 0.0, 1.0 ), Dtk_dir( 1.0, 0.0, 0.0 ), 0.25, 0.1 );
1722  myarcellipse->SetTrimmingParameters( DTK_PI / 2.0, 3.0 * DTK_PI / 2.0 );
1723  ArrayCurve.push_back( Dtk_CurvePtr::DtkDynamicCast( myarcellipse ) );
1724 
1725 
1726  Dtk_BodyPtr mybody;
1727  mybody = Dtk_Body::Create();
1728 
1729  Dtk_ShellPtr myshell;
1730  myshell = Dtk_Shell::Create( mybody );
1731 
1732  myshell->AddWire( ArrayPoint );
1733  myshell->AddWire( ArrayCurve );
1734 
1735  mybody->AddWireShell( myshell );
1736 
1737  mybody->info() = Dtk_Info::create();
1738  mybody->info()->SetColor( Dtk_RGB( 255, 0, 0 ) );
1739  mybody->info()->SetName( L"CreateEsquisse2D" );
1740 
1741  Dtk_transfo transfo;
1742  transfo.setOrigin( -100.0, 0.0, 0.0 );
1743  transfo.setScale( 10.0 );
1744  mybody->Transform( transfo );
1745 
1746  Dtk_MetaDataPtr metadata = Dtk_MetaData::CreateMetaData( Dtk_MetaData::TypeProperty, L"Title of esquisse2d", L"Value of esquisse2d" );
1747  Dtk_tab<Dtk_MetaDataPtr> ArrayMetadataEntity;
1748  ArrayMetadataEntity.push_back( metadata );
1749  mybody->info()->SetMetaData( ArrayMetadataEntity );
1750 
1751  return mybody;
1752  }

◆ CreateEsquisse3D()

Dtk_BodyPtr sampleWriter::CreateEsquisse3D ( )
1586  {
1587  Dtk_Size_t NbPoint = 2;
1588  Dtk_Size_t NbLine = 2;
1589  Dtk_Size_t Nbspline = 2;
1590  Dtk_Size_t NbCircle = 2;
1591  Dtk_Size_t NbArcCircle = 2;
1592  Dtk_Size_t NbEllipse = 2;
1593  Dtk_Size_t NbArcEllipse = 2;
1594 
1595 
1596  Dtk_tab<Dtk_PointPtr> ArrayPoint;
1597  Dtk_tab<Dtk_CurvePtr> ArrayCurve;
1598 
1599 
1600  for( Dtk_Size_t i = 0; i < NbPoint; i++ )
1601  {
1602  Dtk_PointPtr mypoint;
1603  mypoint = Dtk_Point::Create( Dtk_pnt( -10.0 + 10 * i, 2.0, 12.0 ) );
1604  mypoint->info() = Dtk_Info::create();
1605  mypoint->info()->SetColor( Dtk_RGB( 255, 0, 0 ) );
1606  Dtk_string name( L"mypoint" );
1607  name.add_int( ( int )i );
1608  mypoint->info()->SetName( name );
1609  ArrayPoint.push_back( mypoint );
1610  }
1611 
1612 
1613  Dtk_tab<Dtk_LinePtr> arraylineptr;
1614  for( Dtk_Size_t i = 0; i < NbLine; i++ )
1615  {
1616  Dtk_LinePtr line = Dtk_Line::Create( Dtk_pnt( -10.0 + 10 * i, 3, 10.0 ), Dtk_pnt( -10.0 + 10 * i, 9, 0.0 ) );
1617  ArrayCurve.push_back( Dtk_CurvePtr::DtkDynamicCast( line ) );
1618  }
1619 
1620  for( Dtk_Size_t i = 0; i < Nbspline; i++ )
1621  {
1622  //add nurbs curve
1623  Dtk_EllipsePtr myellipse;
1624  myellipse = Dtk_Ellipse::Create( Dtk_pnt( -10.0 + 10 * i, 15, 0.0 ), Dtk_dir( 0.0, 0.0, 1.0 ), Dtk_dir( 1.0, 0.0, 0.0 ), 4.0, 2.5 );
1625  Dtk_NurbsCurvePtr nurbs = myellipse->ToNurbs();
1626  ArrayCurve.push_back( Dtk_CurvePtr::DtkDynamicCast( nurbs ) );
1627  }
1628 
1629  for( Dtk_Size_t i = 0; i < NbCircle; i++ )
1630  {
1631  //add nurbs curve
1632  Dtk_EllipsePtr myellipse;
1633  myellipse = Dtk_Ellipse::Create( Dtk_pnt( -10.0 + 10 * i, 22, 5.0 ), Dtk_dir( 0.0, 0.0, 1.0 ), Dtk_dir( 1.0, 0.0, 0.0 ), 4.0 );
1634  ArrayCurve.push_back( Dtk_CurvePtr::DtkDynamicCast( myellipse ) );
1635  }
1636 
1637  for( Dtk_Size_t i = 0; i < NbArcCircle; i++ )
1638  {
1639  //add nurbs curve
1640  Dtk_EllipsePtr myellipse;
1641  myellipse = Dtk_Ellipse::Create( Dtk_pnt( -10.0 + 10 * i, 30, 5.0 ), Dtk_dir( 0.0, 0.0, 1.0 ), Dtk_dir( 1.0, 0.0, 0.0 ), 3.0 );
1642  myellipse->SetTrimmingParameters( 0.0, DTK_PI );
1643  ArrayCurve.push_back( Dtk_CurvePtr::DtkDynamicCast( myellipse ) );
1644  }
1645 
1646  for( Dtk_Size_t i = 0; i < NbEllipse; i++ )
1647  {
1648  Dtk_EllipsePtr myellipse;
1649  myellipse = Dtk_Ellipse::Create( Dtk_pnt( -10.0 + 10 * i, 35, 3.0 ), Dtk_dir( 0.0, 0.0, 1.0 ), Dtk_dir( 1.0, 0.0, 0.0 ), 3.0, 1.0 );
1650  ArrayCurve.push_back( Dtk_CurvePtr::DtkDynamicCast( myellipse ) );
1651  }
1652 
1653  for( Dtk_Size_t i = 0; i < NbArcEllipse; i++ )
1654  {
1655  Dtk_EllipsePtr myellipse;
1656  myellipse = Dtk_Ellipse::Create( Dtk_pnt( -10.0 + 10 * i, 40, 2.0 ), Dtk_dir( 0.0, 0.0, 1.0 ), Dtk_dir( 1.0, 0.0, 0.0 ), 3.0, 1.0 );
1657  myellipse->SetTrimmingParameters( 0.0, DTK_PI );
1658  ArrayCurve.push_back( Dtk_CurvePtr::DtkDynamicCast( myellipse ) );
1659  }
1660 
1661  Dtk_BodyPtr mybody;
1662  mybody = Dtk_Body::Create();
1663 
1664  Dtk_ShellPtr myshell;
1665  myshell = Dtk_Shell::Create( mybody );
1666 
1667  myshell->AddWire( ArrayPoint );
1668  myshell->AddWire( ArrayCurve );
1669 
1670  mybody->AddWireShell( myshell );
1671 
1672  mybody->info() = Dtk_Info::create();
1673  mybody->info()->SetColor( Dtk_RGB( 255, 0, 0 ) );
1674  mybody->info()->SetName( L"CreateEsquisse3D" );
1675 
1676  Dtk_MetaDataPtr metadata = Dtk_MetaData::CreateMetaData( Dtk_MetaData::TypeProperty, L"Title of esquisse3d", L"Value of esquisse3d" );
1677  Dtk_tab<Dtk_MetaDataPtr> ArrayMetadataEntity;
1678  ArrayMetadataEntity.push_back( metadata );
1679  mybody->info()->SetMetaData( ArrayMetadataEntity );
1680 
1681  return mybody;
1682  }

◆ CreateFdtDatum()

Dtk_FdtPtr sampleWriter::CreateFdtDatum ( )

Creates simple Datum.

20  {
22 
23  // Creation of Leader line
24  Dtk_pnt arrow_location( 0., 0. );
25  Dtk_tab<Dtk_pnt> leader_points;
26  leader_points.push_back( Dtk_pnt( 0., 18. ) );
27  //Creation of leader with terminator's height and width 2.0. The terminator is a filled triangle
28  Dtk_LeaderPtr leader = Dtk_Leader::Create( 2.0, 2.0, arrow_location, Dtk_Leader::TerminatorTypeClosedArrow, leader_points );
29  //Creation of symbol
31 
32  // Creation of Text info
33  Dtk_InfoPtr text_info = Dtk_Info::create();
34  //Setting text color to blue
35  text_info->SetColor( 0, 0, 255 );
36  //Setting text style
37  Dtk_bool horiz_vert = 0, mirror = 0, font_index = 0;
38  double slant = 0.;
39  Dtk_TextStyle text_style;
40  //Text height
41  text_style.CharHeight() = 3.5;
42  //Text width
43  text_style.CharWidth() = 2.1;
44  //Text slant
45  text_style.Slant() = slant;
46 
47  //Text value : "A"
48  Dtk_string str( "A" );
49  //Creating text 2D Bounding box
50  Dtk_pnt location( -2., 20. );
51  double XLen = 5., YLen = 5.;
52  Dtk_dir XDir( 1., 0., 0. ), YDir( 0., 0., 1. );
53  Dtk_Oriented2dBBox inbox( location, XLen, YLen, XDir, YDir );
54 
57 
58  //Creating the text itself giving :
59  // - its value
60  // - inside and outside boxes
61  // - anchor type
62  // - text type
63  // - horizontal/vertical text orientation
64  // - text infos
65  // - text style
66  // - text slant - PI / 2.0 for normal text -
67  // - font index
68  // - mirroring type
69  Dtk_Text dtk_text( str, inbox, inbox, dtk_align, text_type, horiz_vert, text_info, text_style, slant, font_index, mirror );
70 
71  //Adding created text to symbol
72  Dtk_CompositeText& texts = symbol->Texts();
73  texts.AddText( dtk_text );
74 
75  //Creating the frame of the text
76  Dtk_tab< Dtk_CurvePtr > FrameGeoms;
77  Dtk_PolylinePtr framePolyline;
78  framePolyline = Dtk_Polyline::Create( Dtk_pnt( -5., 18. ), Dtk_pnt( 5., 18. ) );
79  framePolyline->AddPoint( Dtk_pnt( 5., 28. ) );
80  framePolyline->AddPoint( Dtk_pnt( -5., 28. ) );
81  framePolyline->AddPoint( Dtk_pnt( -5., 18. ) );
82  FrameGeoms.push_back( Dtk_CurvePtr::DtkDynamicCast( framePolyline ) );
83  //Setting the type of the frame
84  symbol->SetFrameType( DTK_FRAME_TYPE_RECTANGLE, FrameGeoms );
85 
86  // Creation of leader line
87  Dtk_InfoPtr leader_info = Dtk_Info::create();
88  leader_info->SetColor( 255, 255, 255 );
89  leader->GetInfo() = leader_info;
90  //Adding leader to symbol
91  symbol->AddLeader( leader );
92  //Setting symbol type
93  symbol->SymbolType() = Dtk_Symbol::TypeDatum;
94  //Adding symbol to FDT
95  fdt->Sub2DEntity() = Dtk_2dEntityPtr::DtkDynamicCast( symbol );
96 
97  //Adding transformation on FDT
98  Dtk_transfo fdt_transf;
99  fdt_transf.setOrigin( Dtk_pnt( 50., 100., 50. ) );
100  fdt->Transform( fdt_transf );
101 
102  //Adding infos on FDT (Name and color)
103  Dtk_InfoPtr fdt_info = Dtk_Info::create();
104  fdt_info->SetColor( 255, 255, 255 );
105  fdt_info->SetName( "Datum:1" );
106  fdt->info() = fdt_info;
107 
108  Dtk_MetaDataPtr metadata = Dtk_MetaData::CreateMetaData( Dtk_MetaData::TypeProperty, L"Title of mydatum", L"Value of mydatum" );
109  Dtk_tab<Dtk_MetaDataPtr> ArrayMetadataEntity;
110  ArrayMetadataEntity.push_back( metadata );
111  fdt->info()->SetMetaData( ArrayMetadataEntity );
112 
113  return fdt;
114  }

◆ CreateGeometricalTolerance()

Dtk_FdtPtr sampleWriter::CreateGeometricalTolerance ( )
230  {
231  Dtk_FdtPtr fdt = Dtk_Fdt::Create();
232  // first create and populate the dimension
233  // Creation of Text info
234  Dtk_InfoPtr text_info = Dtk_Info::create();
235  //Setting text style
236  Dtk_bool horiz_vert = 0, mirror = 0, font_index = 0;
237  double slant = 0.;
238  Dtk_TextStyle text_style;
239  Dtk_dir x_dir( 1, 0, 0 ), normal_dir( 0, 0, 1 );
240  //Text height
241  text_style.CharHeight() = 3.5;
242  //Text width
243  text_style.CharWidth() = 2.1;
244  //Text slant
245  text_style.Slant() = slant;
247 
248 
249 
250 
251  // Create boxes for Container Text
252  Dtk_pnt location_c( 0.0, 0.0 );
253  Dtk_Oriented2dBBox container_box( location_c, 15, 15, x_dir, normal_dir );// to give frame box
254  Dtk_Oriented2dBBox container_boxin = container_box; // to give inner smaller box for text
255  container_boxin.Extend( -2., -2. ); //reduce the initial box
256 
257 
258  //Create Dtk_GeometricalTolerance
260 
261  //Create Dtk_ToleranceSpecification
263 
264  //Create Dtk_ToleranceSpecificationContainer
266  MyGeometricalTolerance->AddToleranceSpecificationContainer( MyContainer );
267 
268 
269  //Create Fulltext for tolerance
270 
271  // Create tolerance
272  Dtk_CompositeText fulltext;
273  Dtk_Text val;
274  Dtk_pnt location_v( 15.0, 0.0 );
275  Dtk_Oriented2dBBox container_boxv( location_v, 20, 15, x_dir, normal_dir );
276  Dtk_Oriented2dBBox container_boxvin = container_boxv;
277  container_boxvin.Extend( -2., -2. );
278 
279 
280  val = Dtk_Text( L"0.02", container_boxvin, container_boxv, dtk_align, DTK_Text_type::dtk_text_type_value, horiz_vert, text_info, text_style, slant, font_index, mirror );
281  fulltext.AddText( val );
282 
283  // Create modifier
284  Dtk_pnt locationm( 35.0, 0.0 );
285  Dtk_Oriented2dBBox container_boxm( locationm, 15, 15, x_dir, normal_dir );
286  Dtk_Oriented2dBBox container_boxmin = container_boxm;
287  container_boxmin.Extend( -2., -2. );
288 
289  Dtk_Text modifier = Dtk_Text( L"\u24C2", container_boxmin, container_boxm, dtk_align, DTK_Text_type::dtk_text_type_modifier, horiz_vert, text_info, text_style, slant, font_index, mirror );
290  fulltext.AddText( modifier );
291 
292  // Create Reference Frame
294 
295  //Add A
296  Dtk_pnt locationA( 50.0, 0.0 );
297  Dtk_Oriented2dBBox container_boxA( locationA, 15, 15, x_dir, normal_dir );
298  Dtk_Oriented2dBBox container_boxAin = container_boxA;
299  container_boxAin.Extend( -2., -2. );
300 
301 
302  Dtk_ReferenceBlockPtr A_Block = Dtk_ReferenceBlock::Create( container_boxAin, container_boxA );
303  A_Block->AddReference( L"A" );
304  RefFrame->AddReferenceBlock( A_Block );
305 
306  // Create Dtk_ToleranceSpecificationPtr
307  Dtk_ToleranceSpecificationPtr MyToleranceSpecification = Dtk_ToleranceSpecification::Create( val, RefFrame );
308  MyToleranceSpecification->SetMainValue( fulltext );
309 
310  //Add it to Container
311  MyContainer->AddToleranceSpecification( MyToleranceSpecification );
312 
313  fdt->Sub2DEntity() = Dtk_2dEntityPtr::DtkDynamicCast( MyGeometricalTolerance );
314 
315 
316  Dtk_InfoPtr fdt_info = Dtk_Info::create();
317  fdt_info->SetColor( 255, 255, 255 );
318  fdt_info->SetName( "GeometricalTolerance" );
319  fdt->info() = fdt_info;
320 
321  return fdt;
322  }

◆ CreateInfinitePlane()

Dtk_BodyPtr sampleWriter::CreateInfinitePlane ( )
1501  {
1502  Dtk_BodyPtr mybody = Dtk_Body::Create();
1503  mybody->info() = Dtk_Info::create();
1504  mybody->info()->SetInfiniteGeometryFlag( DTK_TRUE );
1505  mybody->get_info()->SetRefEntityFlag( DTK_TRUE );
1506 
1507  mybody->info()->SetColor( Dtk_RGB( 255, 0, 0, 255 ) );
1508  mybody->info()->SetName( L"myplan" );
1509 
1510  Dtk_MetaDataPtr metadata = Dtk_MetaData::CreateMetaData( Dtk_MetaData::TypeProperty, L"Title of myplan", L"Value of myplan" );
1511  Dtk_tab<Dtk_MetaDataPtr> ArrayMetadataEntity;
1512  ArrayMetadataEntity.push_back( metadata );
1513  mybody->info()->SetMetaData( ArrayMetadataEntity );
1514 
1515  Dtk_PlaneSurfacePtr plane = Dtk_PlaneSurface::Create( Dtk_pnt( -11, -12, -13 ), Dtk_dir( 0, 0, 1 ), Dtk_dir( 0, 1, 0 ) );
1516  Dtk_Double64 dom[ 4 ];
1517  dom[ 0 ] = 0.0;
1518  dom[ 1 ] = 10.0;
1519  dom[ 2 ] = 0.0;
1520  dom[ 3 ] = 10.0;
1521 
1522  plane->SetTrimUVBox( dom );
1523 
1524  mybody->AddUnboundedFace( Dtk_SurfacePtr::DtkDynamicCast( plane ) );
1525 
1526  return mybody;
1527  }

◆ CreateMeshCube()

Dtk_MeshPtr sampleWriter::CreateMeshCube ( )

Mesh Cube sample.

210  {
211  // Variables
212  Dtk_tab<Dtk_pnt> vertices;
213  Dtk_tab<Dtk_dir> normals;
214  Dtk_tab<Dtk_UInt32> indices;
215  Dtk_tab<Dtk_Float32> uCoords;
216  Dtk_tab<Dtk_Float32> vCoords;
217 
218  // Our mesh
219  Dtk_mesh* outCubeMesh = new Dtk_mesh( DTK_MESH_XYZ | DTK_MESH_NORMAL | DTK_MESH_UV_TEXTURES /*if you have materials*/ ); // coords & normals & materials
220 
221  // PART1 : CREATING GEOMETRY AND UV COORDINATES ARRAYS (HARD CODED here)
222  CreateMeshCubeGeometry( vertices, normals, uCoords, vCoords );
223 
224 
225  // PART2 : STORING geometry (vertices & normals) into the mesh
226 
227  for( Dtk_Size_t i = 0; i < vertices.size(); i++ )
228  {
229  outCubeMesh->add_vertex( &( vertices.at( i ) ), &( normals.at( i ) ), NULL, uCoords[ i ], vCoords[ i ] );
230  }
231 
232  // At this point, vertices & normals are stored, but we have no faces yet
233 
234  // PART3 : BUILDING THE SIX FACES
235  CreateMeshCubeFaces( outCubeMesh );
236 
237  Dtk_RGB rgb( 255, 0, 0 );
238  outCubeMesh->set_mesh_color( rgb ); // red cube
239  outCubeMesh->info() = Dtk_Info::create();
240  outCubeMesh->info()->SetColor( rgb );
241 
242  return outCubeMesh;
243  }

◆ CreateMeshCubeVertexColor()

Dtk_MeshPtr sampleWriter::CreateMeshCubeVertexColor ( )
302  {
303  // Variables
304  Dtk_tab<Dtk_pnt> vertices;
305  Dtk_tab<Dtk_dir> normals;
306  Dtk_tab<Dtk_Float32> uCoords;
307  Dtk_tab<Dtk_Float32> vCoords;
308  Dtk_RGB red( 255, 0, 0 );
309  Dtk_RGB green( 0, 255, 0 );
310  Dtk_RGB blue( 0, 0, 255 );
311  Dtk_RGB all( 255, 255, 255 );
312 
313  // Our mesh
314  Dtk_mesh* outCubeMesh = new Dtk_mesh( DTK_MESH_XYZ | DTK_MESH_NORMAL | DTK_MESH_RGB ); // coords & normals & vertex colors
315 
316  // PART1 : CREATING GEOMETRY ARRAYS (HARD CODED here)
317  CreateMeshCubeGeometry( vertices, normals, uCoords, vCoords );
318 
319  // PART2 : STORING geometry (vertices & normals & vertex color) into the mesh
320 
321  for( Dtk_Size_t i = 0; i < vertices.size(); i += 4 )
322  {
323 
324  outCubeMesh->add_vertex( &( vertices.at( i ) ), &( normals.at( i ) ), &red );
325  outCubeMesh->add_vertex( &( vertices.at( i + 1 ) ), &( normals.at( i + 1 ) ), &green );
326  outCubeMesh->add_vertex( &( vertices.at( i + 2 ) ), &( normals.at( i + 2 ) ), &blue );
327  outCubeMesh->add_vertex( &( vertices.at( i + 3 ) ), &( normals.at( i + 3 ) ), &all );
328  }
329 
330  // At this point, vertices & normals are stored, but we have no faces yet
331 
332  // PART3 : BUILDING THE SIX FACES
333  CreateMeshCubeFaces( outCubeMesh );
334 
335  return outCubeMesh;
336  }

◆ CreateMeshCuboid()

Dtk_MeshPtr sampleWriter::CreateMeshCuboid ( const Dtk_pnt inFirstPoint,
const Dtk_pnt inSecondPoint 
)
461  {
462  // Variables
463  Dtk_tab<Dtk_pnt> vertices;
464  Dtk_tab<Dtk_dir> normals;
465  Dtk_tab<Dtk_UInt32> indices;
466  Dtk_tab<Dtk_Float32> uCoords;
467  Dtk_tab<Dtk_Float32> vCoords;
468 
469  // Our mesh
470  Dtk_mesh* outCuboidMesh = new Dtk_mesh( DTK_MESH_XYZ | DTK_MESH_NORMAL | DTK_MESH_UV_TEXTURES /*if you have materials*/ ); // coords & normals & materials
471 
473  inPoints.first = inFirstPoint;
474  inPoints.second = inSecondPoint;
475 
476  // PART1 : CREATING GEOMETRY AND UV COORDINATES ARRAYS (HARD CODED here)
477  CreateMeshCubeidGeometry( vertices, normals, uCoords, vCoords, inPoints );
478 
479  // PART2 : STORING geometry (vertices & normals) into the mesh
480 
481  for( Dtk_Size_t i = 0; i < vertices.size(); i++ )
482  {
483  outCuboidMesh->add_vertex( &( vertices.at( i ) ), &( normals.at( i ) ), NULL, uCoords[ i ], vCoords[ i ] );
484  }
485 
486  // At this point, vertices & normals are stored, but we have no faces yet
487 
488  // PART3 : BUILDING THE SIX FACES
489  CreateMeshCubeFaces( outCuboidMesh );
490 
491  Dtk_RGB rgb( 255, 0, 0 );
492  outCuboidMesh->set_mesh_color( rgb ); // red cube
493  outCuboidMesh->info() = Dtk_Info::create();
494  outCuboidMesh->info()->SetColor( rgb );
495 
496  return outCuboidMesh;
497  }

◆ CreateMeshCylinder()

Dtk_MeshPtr sampleWriter::CreateMeshCylinder ( int  nbpoints)

Mesh Cylinder sample.

340  {
341  // Variables
342  Dtk_mesh_face* face = NULL;
343  Dtk_tab<Dtk_pnt> vertices;
344  Dtk_tab<Dtk_dir> normals;
345  Dtk_tab<Dtk_UInt32> indices;
346 
347  if( nbpoints < 3 )
348  {
349  return NULL;
350  }
351 
352  // Our mesh
353  Dtk_mesh* outCylinderMesh = new Dtk_mesh( DTK_MESH_XYZ | DTK_MESH_NORMAL ); // coords & normals
354 
355  Dtk_Size_t i;
356  double radius = 3;
357  double height = 5;
358  for( i = 0; i < ( Dtk_Size_t )nbpoints; i++ )
359  {
360  double angle = i * 2 * DTK_PI / nbpoints;
361  normals.push_back( Dtk_pnt( cos( angle ), sin( angle ), 0 ) );
362  vertices.push_back( radius * Dtk_pnt( cos( angle ), sin( angle ) ) + Dtk_pnt( 0, 0, height ) );
363  normals.push_back( Dtk_pnt( cos( angle ), sin( angle ), 0 ) );
364  vertices.push_back( radius * Dtk_pnt( cos( angle ), sin( angle ), 0 ) );
365  indices.push_back( ( Dtk_UInt32 )indices.size() );
366  indices.push_back( ( Dtk_UInt32 )indices.size() );
367  }
368  indices.push_back( 0 );
369  indices.push_back( 1 );
370 
371  face = new Dtk_mesh_face( outCylinderMesh );
372  face->add_triangle_strip( &indices, &vertices, &normals );
373  outCylinderMesh->add_mesh_face( face );
374 
375  Dtk_RGB rgb( 255, 255, 0, 128 );
376  outCylinderMesh->set_mesh_color( rgb ); // yellow transparent cylinder
377  outCylinderMesh->info() = Dtk_Info::create();
378  outCylinderMesh->info()->SetColor( rgb );
379 
380 
381  Dtk_MetaDataPtr metadata = Dtk_MetaData::CreateMetaData( Dtk_MetaData::TypeProperty, L"Title of mymesh", L"Value of mymesh" );
382  Dtk_tab<Dtk_MetaDataPtr> ArrayMetadataEntity;
383  ArrayMetadataEntity.push_back( metadata );
384  outCylinderMesh->info()->SetMetaData( ArrayMetadataEntity );
385 
386  return outCylinderMesh;
387  }

◆ CreateMeshPoints()

Dtk_MeshPtr sampleWriter::CreateMeshPoints ( )

Points mesh sample.

442  {
443  Dtk_mesh* outPointMesh = new Dtk_mesh( DTK_MESH_XYZ ); // coords
444  outPointMesh->info() = Dtk_Info::create();
445  outPointMesh->info()->SetColor( Dtk_RGB( 255, 100, 0 ) );
446  Dtk_mesh_face* face = new Dtk_mesh_face( outPointMesh );
447  double coords[ 8 ][ 3 ] = { {-1,-1,-1},{-1,-1,1},{-1,1,-1},{-1,1,1},
448  {1,-1,-1},{1,-1,1},{1,1,-1},{1,1,1} };
449  int i;
450  for( i = 0; i < 8; i++ )
451  {
452  Dtk_pnt P( coords[ i ][ 0 ], coords[ i ][ 1 ], coords[ i ][ 2 ] );
453  outPointMesh->add_vertex( &P );
454  face->add_point( i );
455  }
456  outPointMesh->add_mesh_face( face );
457  return outPointMesh;
458  }

◆ CreateMeshWire()

Dtk_MeshPtr sampleWriter::CreateMeshWire ( )

Wire mesh sample.

391  {
392  // Variables
393  Dtk_mesh_face* face = NULL;
394  Dtk_tab<Dtk_pnt> vertices;
395  Dtk_tab<Dtk_dir> normals;
396  Dtk_tab<Dtk_UInt32> indices;
397  Dtk_Size_t i, numVertices;
398  Dtk_InfoPtr info = NULL;
399 
400  // Our mesh
401  Dtk_mesh* outWireMesh = new Dtk_mesh( DTK_MESH_XYZ ); // coords
402 
403  face = new Dtk_mesh_face( outWireMesh );
404 
405  //free curves
406  vertices.push_back( Dtk_pnt( -1.0f, 1.0f, 1.0f ) ); //0.,1.,0.
407  vertices.push_back( Dtk_pnt( -1.0f, 1.0f, -1.0f ) );
408  vertices.push_back( Dtk_pnt( 1.0f, 1.0f, -1.0f ) );
409  vertices.push_back( Dtk_pnt( 1.0f, 1.0f, 1.0f ) );
410 
411  numVertices = vertices.size();
412  for( i = 0; i < numVertices; i++ )
413  {
414  indices.push_back( ( Dtk_UInt32 )i );
415  }
416  indices.push_back( 0 );
417 
418  info = Dtk_Info::create();
419  info->SetColor( Dtk_RGB( 0, 0, 255 ) );
420  face->add_polyline( &indices, &vertices );
421  face->add_subinfo( info );
422  outWireMesh->add_mesh_face( face );
423 
424  //free vertex
425  info = NULL;
426  info = Dtk_Info::create();
427  vertices.clear();
428  indices.clear();
429  face = new Dtk_mesh_face( outWireMesh );
430  vertices.push_back( Dtk_pnt( 0.0f, 1.0f, 0.0f ) );
431  indices.push_back( 0 );
432  info->SetColor( Dtk_RGB( 255, 0, 0 ) );
433  face->add_points( &indices, &vertices );
434  face->add_subinfo( info );
435  outWireMesh->add_mesh_face( face );
436 
437  return outWireMesh;
438  }

◆ CreateMixedBody()

Dtk_BodyPtr sampleWriter::CreateMixedBody ( )
1821  {
1822  Dtk_BodyPtr body = CreateCube();
1823 
1824  Dtk_CylindricalSurfacePtr cyl = Dtk_CylindricalSurface::Create( Dtk_pnt( -20.0, -20.0, 0.0 ), Dtk_dir( 0.0, 0.0, 1.0 ), Dtk_dir( 1.0, 0.0, 0.0 ), 10.0 );
1825  Dtk_Double64 domain[] = { 0.0,6.0,0.0,100.0 };
1826  cyl->SetTrimUVBox( domain );
1827  cyl->info() = Dtk_Info::create();
1828  cyl->info()->SetColor( Dtk_RGB( 255, 0, 0 ) );
1829  body->AddUnboundedFace( Dtk_SurfacePtr::DtkDynamicCast( cyl ) );
1830 
1831 
1832  cyl = Dtk_CylindricalSurface::Create( Dtk_pnt( -20.0, 20.0, 0.0 ), Dtk_dir( 0.0, 0.0, 1.0 ), Dtk_dir( 1.0, 0.0, 0.0 ), 10.0 );
1833  Dtk_Double64 domain2[] = { 0.0,3.14,-50.0,50.0 };
1834  cyl->SetTrimUVBox( domain2 );
1835  cyl->info() = Dtk_Info::create();
1836  cyl->info()->SetColor( Dtk_RGB( 0, 255, 0 ) );
1837  body->AddUnboundedFace( Dtk_SurfacePtr::DtkDynamicCast( cyl ) );
1838 
1839  return body;
1840  }

◆ CreateModelDisplayActivated()

Dtk_ModelDisplayPtr sampleWriter::CreateModelDisplayActivated ( )
325  {
326  Dtk_ModelDisplayPtr resMD;
327  Dtk_pnt from = Dtk_pnt( 300, 300, 300 );
328  Dtk_pnt to( 0, 0, 0 );
329  Dtk_pnt up = Dtk_dir( -0.57735, 0.57735, -0.57735 );
330  Dtk_CameraPtr cam = Dtk_Camera::Create( from, to, 250, 250, up );
331  resMD = Dtk_ModelDisplay::Create( cam, NULL, DTK_TRUE );// create activated model display
332  resMD->info() = Dtk_Info::create();
333  resMD->info()->SetName( "MyView1" );
334  return resMD;
335  }

◆ CreateModelDisplayDesactivated()

Dtk_ModelDisplayPtr sampleWriter::CreateModelDisplayDesactivated ( )
338  {
339  Dtk_ModelDisplayPtr resMD;
340  Dtk_pnt from( 0, 0, 100 );
341  Dtk_pnt to( 0, 0, 0 );
342  Dtk_dir up( 0, 1, 0 );
343  Dtk_CameraPtr cam = Dtk_Camera::Create( from, to, 100, 100, up ); // semiwidth = 100
344  resMD = Dtk_ModelDisplay::Create( cam, NULL, DTK_FALSE ); // create desactivated model display
345  resMD->info() = Dtk_Info::create();
346  resMD->info()->SetName( "MyView2" );
347  return resMD;
348  }

◆ CreateModelDisplayWithSection()

Dtk_ModelDisplayPtr sampleWriter::CreateModelDisplayWithSection ( )
351  {
352  Dtk_ModelDisplayPtr resMD;
353  Dtk_PlaneSurfacePtr section = Dtk_PlaneSurface::Create( Dtk_pnt(), Dtk_dir( 0.75, -0.4, 0. ), Dtk_dir( 0., 0., 1. ) );
355  resMD = Dtk_ModelDisplay::Create( mv1->GetCamera(), Dtk_EntityPtr::DtkDynamicCast( section ), DTK_FALSE ); // create second desactivated view with section
356  resMD->info() = Dtk_Info::create();
357  resMD->info()->SetName( "MySectionView" );
358 
359  return resMD;
360  }

◆ CreateOpenShell()

Dtk_BodyPtr sampleWriter::CreateOpenShell ( )
1348  {
1349  Dtk_BodyPtr body = Dtk_Body::Create(); // create the Body
1350  Dtk_CylindricalSurfacePtr cyl = Dtk_CylindricalSurface::Create( Dtk_pnt( 0.0, 0.0, 0.0 ), Dtk_dir( 0.0, 0.0, 1.0 ), Dtk_dir( 1.0, 0.0, 0.0 ), 10.0 );
1351  Dtk_Double64 domain[] = { 0.0,3.14,-5.0,5.0 };
1352  cyl->SetTrimUVBox( domain );
1353  body->AddUnboundedFace( Dtk_SurfacePtr::DtkDynamicCast( cyl ) );
1354 
1355  //For an open shell you can also create an OpenShell and call
1356  //body->AddOpenShell(shell);
1357 
1358  return body;
1359  }

◆ CreateOpenShell_2()

Dtk_BodyPtr sampleWriter::CreateOpenShell_2 ( )
1101  {
1102  Dtk_BodyPtr body = Dtk_Body::Create(); // create the Body
1103  Dtk_CylindricalSurfacePtr cyl = Dtk_CylindricalSurface::Create( Dtk_pnt( 0.0, 0.0, 0.0 ), Dtk_dir( 0.0, 0.0, 1.0 ), Dtk_dir( 1.0, 0.0, 0.0 ), 10.0 );
1104  Dtk_Double64 domain[] = { 0.0,3.14,-5.0,5.0 };
1105  cyl->SetTrimUVBox( domain );
1106  body->AddUnboundedFace( Dtk_SurfacePtr::DtkDynamicCast( cyl ) );
1107 
1108  //For an open shell you can also create an OpenShell and call
1109  //body->AddOpenShell(shell);
1110 
1111  return body;
1112  }

◆ CreatePoint()

Dtk_BodyPtr sampleWriter::CreatePoint ( )
1474  {
1475  Dtk_tab<Dtk_PointPtr> mypoints;
1476  Dtk_BodyPtr mybody;
1477  mybody = Dtk_Body::Create();
1478 
1479  Dtk_ShellPtr myshell;
1480  myshell = Dtk_Shell::Create( mybody );
1481 
1482  Dtk_PointPtr mypoint;
1483  mypoint = Dtk_Point::Create( Dtk_pnt( -10.0, 11.0, 12.0 ) );
1484  mypoint->info() = Dtk_Info::create();
1485  mypoint->info()->SetColor( Dtk_RGB( 255, 0, 0 ) );
1486  mypoint->info()->SetName( "mypoint" );
1487 
1488  Dtk_MetaDataPtr metadata = Dtk_MetaData::CreateMetaData( Dtk_MetaData::TypeProperty, L"Title of mypoint", L"Value of mypoint" );
1489  Dtk_tab<Dtk_MetaDataPtr> ArrayMetadataEntity;
1490  ArrayMetadataEntity.push_back( metadata );
1491  mypoint->info()->SetMetaData( ArrayMetadataEntity );
1492 
1493  mypoints.push_back( mypoint );
1494 
1495  myshell->AddWire( mypoints );
1496  mybody->AddWireShell( myshell );
1497  return mybody;
1498  }

◆ CreateTexturedMeshCube()

Dtk_MeshPtr sampleWriter::CreateTexturedMeshCube ( const Dtk_string inImageDirectory)

Textured Mesh Cube sample.

275  {
276  // Our mesh
277  Dtk_MeshPtr outCubeMesh = CreateMeshCube();
278 
279  // create mesh texture with cubical mapping
280  Dtk_RenderInfosPtr meshRender = Dtk_RenderInfos::Create( "meshRender" );
282  meshTexture->SetImagePath( inImageDirectory + "sample.bmp" );
283  meshTexture->SetScale( 2., 2. ); // image scale
284  meshRender->SetTexture( meshTexture );
285  outCubeMesh->info()->AddRenderInfos( meshRender ); // apply texture to mesh
286  outCubeMesh->info()->SetName( "TexturedMesh" );
287 
288  // create face render texture
289  Dtk_RenderInfosPtr faceRender = Dtk_RenderInfos::Create( "faceRender" );
291  faceTexture->SetImagePath( inImageDirectory + "logodtk.bmp" );
292  faceTexture->SetScale( 2., 2. ); // image scale
293  faceRender->SetTexture( faceTexture );
294  if( outCubeMesh->get_mesh_face( 2 )->info().IsNULL() )
295  outCubeMesh->get_mesh_face( 2 )->info() = Dtk_Info::create();
296  outCubeMesh->get_mesh_face( 2 )->info()->AddRenderInfos( faceRender ); // apply texture to face
297 
298  return outCubeMesh;
299  }

◆ FillFacesColors()

void sampleWriter::FillFacesColors ( Dtk_MeshPtr inoutCubeMesh)

Filling mesh faces with colors.

247  {
248  Dtk_InfoPtr infoFace0 = Dtk_Info::create();
249  infoFace0->SetColor( Dtk_RGB( 255, 1, 0 ) );
250  inoutCubeMesh->get_mesh_face( 0 )->info() = infoFace0;
251 
252  Dtk_InfoPtr infoFace1 = Dtk_Info::create();
253  infoFace1->SetColor( Dtk_RGB( 0, 255, 0 ) );
254  inoutCubeMesh->get_mesh_face( 1 )->info() = infoFace1;
255 
256  Dtk_InfoPtr infoFace2 = Dtk_Info::create();
257  infoFace2->SetColor( Dtk_RGB( 0, 0, 255 ) );
258  inoutCubeMesh->get_mesh_face( 2 )->info() = infoFace2;
259 
260  Dtk_InfoPtr infoFace3 = Dtk_Info::create();
261  infoFace3->SetColor( Dtk_RGB( 255, 255, 0 ) );
262  inoutCubeMesh->get_mesh_face( 3 )->info() = infoFace3;
263 
264  Dtk_InfoPtr infoFace4 = Dtk_Info::create();
265  infoFace4->SetColor( Dtk_RGB( 0, 255, 255 ) );
266  inoutCubeMesh->get_mesh_face( 4 )->info() = infoFace4;
267 
268  Dtk_InfoPtr infoFace5 = Dtk_Info::create();
269  infoFace5->SetColor( Dtk_RGB( 255, 128, 0 ) );
270  inoutCubeMesh->get_mesh_face( 5 )->info() = infoFace5;
271  }
sampleWriter::Coedge0_DC
@ Coedge0_DC
Definition: testcreatecube.cpp:43
sampleWriter::Coedge3_HC
@ Coedge3_HC
Definition: testcreatecube.cpp:57
Dtk_ModelDisplay::Create
static Dtk_ModelDisplayPtr Create(const Dtk_CameraPtr &inCamera, const Dtk_EntityPtr &inClippingEntity, const Dtk_bool inIsActivated)
Calls full featured constructor to allocate a new object.
Dtk_ToleranceSpecification::Create
static Dtk_ToleranceSpecificationPtr Create()
Calls default constructor to allocate a new object.
sampleWriter::Loop5_EHCA
@ Loop5_EHCA
Definition: testcreatecube.cpp:68
Dtk_pair
Definition: util_stl_dtk.hpp:919
DTK_MESH_NORMAL
#define DTK_MESH_NORMAL
Definition: util_mesh_dtk.hpp:31
sampleWriter::Edge_GD
@ Edge_GD
Definition: testcreatecube.cpp:34
Dtk_transfo
This is the Transformation dedicated class.
Definition: dtk_transfo.hpp:19
Dtk_mesh_face
This is a high level face class.
Definition: util_mesh_dtk.hpp:865
Dtk_RGB::SetRGBA
void SetRGBA(const int &inRed, const int &inGreen, const int &inBlue, const int &inAlpha=-1)
Definition: dtk_rgb.hpp:49
Dtk_TextureInfos::Create
static Dtk_TextureInfosPtr Create(const TextureMappingTypeEnum &inType)
Create a Dtk_TextureInfosPtr.
sampleWriter::Coedge3_GD
@ Coedge3_GD
Definition: testcreatecube.cpp:53
Dtk_Info::AddAttribute
Dtk_ErrorStatus AddAttribute(Dtk_string name, Dtk_Val val)
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.
sampleWriter::Vertex_A
@ Vertex_A
Definition: testcreatecube.cpp:19
Dtk_Info::SetName
Dtk_ErrorStatus SetName(Dtk_string inName)
sampleWriter::Edge_FB
@ Edge_FB
Definition: testcreatecube.cpp:32
sampleWriter::CreateMeshCube
Dtk_MeshPtr CreateMeshCube()
Mesh Cube sample.
Definition: testcreatemesh.cpp:209
Dtk_TextStyle
This is the text_style. This class gathers information about text style.
Definition: util_draw_dtk.hpp:253
sampleWriter::Coedge5_CA
@ Coedge5_CA
Definition: testcreatecube.cpp:42
Dtk_transfo::setOrigin
void setOrigin(const Dtk_pnt &O)
Set a new O center point.
Dtk_transfo::setZdir
void setZdir(const Dtk_dir &Z)
Set a new Z vector.
sampleWriter::Shell
@ Shell
Definition: testcreatecube.cpp:18
sampleWriter::Edge_FE
@ Edge_FE
Definition: testcreatecube.cpp:33
Dtk_Loop::Create
static Dtk_LoopPtr Create(const Dtk_BodyPtr &inParentBody)
Create a loop in a body.
sampleWriter::Coedge4_HG
@ Coedge4_HG
Definition: testcreatecube.cpp:60
sampleWriter::Coedge5_EH
@ Coedge5_EH
Definition: testcreatecube.cpp:62
DTK_TRUE
#define DTK_TRUE
Definition: define.h:729
Dtk_ToleranceSpecificationContainer::Create
static Dtk_ToleranceSpecificationContainerPtr Create(const Dtk_ToleranceSpecificationContainer &in)
Calls copy constructor to allocate a new object.
dtk_text_type_value
@ dtk_text_type_value
Definition: str_def.h:14
Dtk_UInt32
uint32_t Dtk_UInt32
Definition: define.h:690
Dtk_string
This is a high level string class.
Definition: dtk_string.hpp:58
DTK_ANCHOR_BOTTOM_LEFT
@ DTK_ANCHOR_BOTTOM_LEFT
Definition: util_draw_dtk.hpp:100
Dtk_Size_t
size_t Dtk_Size_t
Definition: define.h:714
sampleWriter::Volume
@ Volume
Definition: testcreatecube.cpp:17
sampleWriter::Coedge4_GF
@ Coedge4_GF
Definition: testcreatecube.cpp:56
Dtk_mesh_face::add_triangle_strip
int add_triangle_strip(const Dtk_tab< Dtk_UInt32 > *inIndices)
Add one triangle strip.
sampleWriter::Edge_BD
@ Edge_BD
Definition: testcreatecube.cpp:30
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:1112
sampleWriter::Edge_HC
@ Edge_HC
Definition: testcreatecube.cpp:36
Dtk_RenderInfos::Create
static Dtk_RenderInfosPtr Create(const Dtk_string &inName)
Create a Dtk_RenderInfosPtr.
Dtk_AxisSystem::create
static Dtk_SmartPtr< Dtk_AxisSystem > create()
Calls default constructor to allocate a new object.
Dtk_Info::SetMetaData
Dtk_ErrorStatus SetMetaData(Dtk_tab< Dtk_MetaDataPtr > &inArray)
sampleWriter::Coedge5_EA
@ Coedge5_EA
Definition: testcreatecube.cpp:48
sampleWriter::Coedge3_HG
@ Coedge3_HG
Definition: testcreatecube.cpp:59
Dtk_Body::Create
static Dtk_BodyPtr Create()
Create a body.
DTK_MESH_XYZ
#define DTK_MESH_XYZ
Definition: util_mesh_dtk.hpp:30
Dtk_LightMap::Create
static Dtk_LightMapPtr Create(Dtk_RGB inAmbiant, Dtk_RGB inDiffuse, Dtk_RGB inSpecular)
Create a Dtk_LightMapPtr.
DTK_FALSE
#define DTK_FALSE
Definition: define.h:730
sampleWriter::Edge_CA
@ Edge_CA
Definition: testcreatecube.cpp:28
sampleWriter::Coedge0_BD
@ Coedge0_BD
Definition: testcreatecube.cpp:45
Dtk_bool
char Dtk_bool
Definition: define.h:727
Dtk_TextStyle::Slant
Dtk_Double64 & Slant()
Retrieves the text slant - get/set -.
Dtk_mesh::add_vertex
int add_vertex(const Dtk_pnt *inVertex, const Dtk_dir *inNormal=NULL, const Dtk_RGB *inColor=NULL, Dtk_Float32 inU=0., Dtk_Float32 inV=0., Dtk_Float32 inUBrep=0., Dtk_Float32 inVBrep=0.)
Add a vertex to the mesh vertices list.
Dtk_RenderInfos::SetTexture
void SetTexture(const Dtk_TextureInfosPtr &inTexture)
Set Dtk_Texture.
Dtk_Symbol::Create
static Dtk_SymbolPtr Create()
Calls default constructor to allocate a new object.
DTK_MESH_UV_TEXTURES
#define DTK_MESH_UV_TEXTURES
Definition: util_mesh_dtk.hpp:33
DTK_ANCHOR_MIDDLE_CENTER
@ DTK_ANCHOR_MIDDLE_CENTER
Definition: util_draw_dtk.hpp:98
sampleWriter::Coedge2_GF
@ Coedge2_GF
Definition: testcreatecube.cpp:55
sampleWriter::Edge_EH
@ Edge_EH
Definition: testcreatecube.cpp:38
Dtk_Double64
double Dtk_Double64
Definition: define.h:701
sampleWriter::Vertex_H
@ Vertex_H
Definition: testcreatecube.cpp:26
Dtk_transfo::setXdir
void setXdir(const Dtk_dir &X)
Set a new X vector.
sampleWriter::Coedge2_FB
@ Coedge2_FB
Definition: testcreatecube.cpp:50
Dtk_mesh
This is a high level mesh class.
Definition: util_mesh_dtk.hpp:485
Dtk_Dimension::DistanceDimension
@ DistanceDimension
Definition: util_draw_dtk.hpp:4750
Dtk_pair::first
T1 first
Definition: util_stl_dtk.hpp:921
Dtk_TextStyle::CharWidth
Dtk_Double64 & CharWidth()
Retrieves the char width - get/set -.
sampleWriter::FaceABCD
@ FaceABCD
Definition: testcreatecube.cpp:69
Dtk_Val
Definition: dtk_val.hpp:67
Dtk_mesh_face::add_subinfo
int add_subinfo(Dtk_InfoPtr &ininf)
Dtk_Face::Create
static Dtk_FacePtr Create(const Dtk_BodyPtr &inParentBody)
Create a face in a body.
sampleWriter::Vertex_G
@ Vertex_G
Definition: testcreatecube.cpp:25
sampleWriter::Coedge4_FE
@ Coedge4_FE
Definition: testcreatecube.cpp:54
DTK_MESH_RGB
#define DTK_MESH_RGB
Definition: util_mesh_dtk.hpp:32
DTK_DASHED
@ DTK_DASHED
Definition: util_ent_dtk.hpp:51
sampleWriter::Loop0_ABCD
@ Loop0_ABCD
Definition: testcreatecube.cpp:63
sampleWriter::FaceABFE
@ FaceABFE
Definition: testcreatecube.cpp:70
Dtk_ReferenceBlock::Create
static Dtk_ReferenceBlockPtr Create(const Dtk_Oriented2dBBox &inInnerBBox, const Dtk_Oriented2dBBox &inOuterBBox)
Calls full featured constructor to allocate a new object.
sampleWriter::FaceGDCH
@ FaceGDCH
Definition: testcreatecube.cpp:72
sampleWriter::Coedge3_DC
@ Coedge3_DC
Definition: testcreatecube.cpp:44
sampleWriter::Vertex_B
@ Vertex_B
Definition: testcreatecube.cpp:20
sampleWriter::FaceEFGH
@ FaceEFGH
Definition: testcreatecube.cpp:73
Dtk_ReferenceFrame::Create
static Dtk_ReferenceFramePtr Create()
Calls default constructor to allocate a new object.
sampleWriter::Edge_EA
@ Edge_EA
Definition: testcreatecube.cpp:31
sampleWriter::Edge_AB
@ Edge_AB
Definition: testcreatecube.cpp:27
Dtk_anchor_type
Dtk_anchor_type
Definition: util_draw_dtk.hpp:93
sampleWriter::Edge_GF
@ Edge_GF
Definition: testcreatecube.cpp:35
DTK_Text_type
DTK_Text_type
Definition: str_def.h:11
Dtk_Int32
int32_t Dtk_Int32
Definition: define.h:689
Dtk_tab::resize
void resize(Dtk_Size_t n, const T &t)
Resizes the array.
Definition: util_stl_dtk.hpp:605
DTK_DOTTED
@ DTK_DOTTED
Definition: util_ent_dtk.hpp:57
Dtk_Symbol::TypeDatum
@ TypeDatum
Definition: util_draw_dtk.hpp:6373
sampleWriter::Coedge2_GD
@ Coedge2_GD
Definition: testcreatecube.cpp:52
sampleWriter::Loop1_ABFE
@ Loop1_ABFE
Definition: testcreatecube.cpp:64
Dtk_Dimension::Create
static Dtk_DimensionPtr Create()
Calls default constructor to allocate a new object.
Dtk_MetaData::TypeProperty
@ TypeProperty
Definition: dtk_metadata.hpp:28
Dtk_Dimension::DimensionTypeEnum
DimensionTypeEnum
Definition: util_draw_dtk.hpp:4730
Dtk_Lump::Create
static Dtk_LumpPtr Create(const Dtk_BodyPtr &inParentBody)
Create a lump in a body.
sampleWriter::Vertex_D
@ Vertex_D
Definition: testcreatecube.cpp:22
Dtk_mesh_face::add_point
int add_point(Dtk_UInt32 inpnt)
Dtk_pair::second
T2 second
Definition: util_stl_dtk.hpp:922
Dtk_SmartPtr::DtkDynamicCast
static Dtk_SmartPtr< T > DtkDynamicCast(const Dtk_SmartPtr< T2 > &p)
Definition: util_ptr_dtk.hpp:101
Dtk_mesh::set_mesh_color
void set_mesh_color(const Dtk_RGB &inColor)
set color in Dtk_mesh
sampleWriter::Coedge1_FB
@ Coedge1_FB
Definition: testcreatecube.cpp:49
sampleWriter::Vertex_C
@ Vertex_C
Definition: testcreatecube.cpp:21
Dtk_SmartPtr::IsNULL
Dtk_bool IsNULL() const
Definition: util_ptr_dtk.hpp:118
Dtk_Fdt::Create
static Dtk_FdtPtr Create()
Calls default constructor to allocate a new object.
Dtk_NurbsCurve::Create
static Dtk_NurbsCurvePtr Create(const Dtk_NurbsCurve &in)
Calls copy constructor to allocate a new object.
Dtk_transfo::setScale
void setScale(Dtk_Double64 scale)
Set a new scale.
Dtk_SmartPtr
Definition: util_ptr_dtk.hpp:37
Dtk_Edge::Create
static Dtk_EdgePtr Create(const Dtk_BodyPtr &inParentBody)
Create an edge in a body.
sampleWriter::FaceFBDG
@ FaceFBDG
Definition: testcreatecube.cpp:71
sampleWriter::Lump
@ Lump
Definition: testcreatecube.cpp:16
Dtk_Point::Create
static Dtk_PointPtr Create(const Dtk_Point &in)
Calls copy constructor to allocate a new object.
sampleWriter::Coedge1_EA
@ Coedge1_EA
Definition: testcreatecube.cpp:47
Dtk_transfo::setYdir
void setYdir(const Dtk_dir &Y)
Set a new Y vector.
dtk_text_type_modifier
@ dtk_text_type_modifier
Definition: str_def.h:21
Dtk_pnt
This is a mathematical point class.
Definition: dtk_pnt.hpp:22
sampleWriter::Coedge4_EH
@ Coedge4_EH
Definition: testcreatecube.cpp:61
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:1536
sampleWriter::Coedge2_BD
@ Coedge2_BD
Definition: testcreatecube.cpp:46
Dtk_Leader::Create
static Dtk_LeaderPtr Create()
Calls default constructor to allocate a new object.
Dtk_Camera::Create
static Dtk_CameraPtr Create()
Calls default constructor to allocate a new object.
sampleWriter::CreateModelDisplayActivated
Dtk_ModelDisplayPtr CreateModelDisplayActivated()
Definition: testcreatefdt.cpp:324
Dtk_Leader::TerminatorTypeClosedArrow
@ TerminatorTypeClosedArrow
Definition: util_draw_dtk.hpp:1972
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 -.
Dtk_tab
This is a high level array class.
Definition: util_stl_dtk.hpp:85
Dtk_Vertex::Create
static Dtk_VertexPtr Create(const Dtk_BodyPtr &inParentBody)
Create a vertex in a body.
Dtk_Coedge::Create
static Dtk_CoedgePtr Create(const Dtk_BodyPtr &inParentBody)
Create a coedge in a body.
sampleWriter::CreateCube
Dtk_BodyPtr CreateCube()
Definition: testcreatecube.cpp:1320
Dtk_tab::size
Dtk_Size_t size() const
Returns the size of the array.
Definition: util_stl_dtk.hpp:504
sampleWriter::FaceEHCA
@ FaceEHCA
Definition: testcreatecube.cpp:74
sampleWriter::Vertex_F
@ Vertex_F
Definition: testcreatecube.cpp:24
sampleWriter::Coedge5_HC
@ Coedge5_HC
Definition: testcreatecube.cpp:58
sampleWriter::Coedge1_AB
@ Coedge1_AB
Definition: testcreatecube.cpp:40
sampleWriter::Coedge0_AB
@ Coedge0_AB
Definition: testcreatecube.cpp:39
Dtk_Leader::LeaderTerminatorTypeEnum
LeaderTerminatorTypeEnum
Internal leader terminator type.
Definition: util_draw_dtk.hpp:1966
Dtk_tab::at
T & at(Dtk_Size_t k)
Definition: util_stl_dtk.hpp:398
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.
DTK_FRAME_TYPE_RECTANGLE
@ DTK_FRAME_TYPE_RECTANGLE
Definition: util_draw_dtk.hpp:130
sampleWriter::Coedge0_CA
@ Coedge0_CA
Definition: testcreatecube.cpp:41
Dtk_GeometricalTolerance::Create
static Dtk_GeometricalTolerancePtr Create()
Calls default constructor to allocate a new object.
Dtk_tab::clear
void clear(int no_delete=0)
Resets the Dtk_tab content.
Definition: util_stl_dtk.hpp:353
Dtk_CompositeText::AddText
void AddText(Dtk_Text inText)
Adds a Dtk_Text to the Dtk_CompositeText.
sampleWriter::Edge_DC
@ Edge_DC
Definition: testcreatecube.cpp:29
Dtk_TextureInfos::CubicalMapping
@ CubicalMapping
Definition: dtk_render.hpp:42
Dtk_Ellipse::Create
static Dtk_EllipsePtr Create(const Dtk_Ellipse &in)
Calls copy constructor to allocate a new object.
Dtk_RGB
Definition: dtk_rgb.hpp:7
Dtk_Info::SetColor
Dtk_ErrorStatus SetColor(const int &R, const int &G, const int &B)
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:471
sampleWriter::Coedge1_FE
@ Coedge1_FE
Definition: testcreatecube.cpp:51
Dtk_Polyline::Create
static Dtk_PolylinePtr Create(const Dtk_Polyline &in)
Calls copy constructor to allocate a new object.
Dtk_mesh::add_mesh_face
int add_mesh_face(Dtk_mesh_face *inMesh_face)
Add a face (Dtk_mesh_face) to the mesh.
Dtk_dir
This is a mathematical direction class.
Definition: dtk_dir.hpp:15
Dtk_Oriented2dBBox::Extend
void Extend(const Dtk_Double64 &inXExtend, const Dtk_Double64 &inYExtend)
Extend the bounding box.
Dtk_mesh_face::add_polyline
int add_polyline(const Dtk_tab< Dtk_UInt32 > *inIndices)
Add one polyline.
Dtk_mesh_face::add_points
int add_points(const Dtk_tab< Dtk_UInt32 > *pnts)
sampleWriter::Vertex_E
@ Vertex_E
Definition: testcreatecube.cpp:23
Dtk_Volume::Create
static Dtk_VolumePtr Create(const Dtk_BodyPtr &inParentBody)
Create a volume in a body.
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_ToleranceSpecificationContainer::TypePosition
@ TypePosition
Definition: util_draw_dtk.hpp:6087
DTK_PI
#define DTK_PI
Definition: str_def.h:8
sampleWriter::Loop3_GDCH
@ Loop3_GDCH
Definition: testcreatecube.cpp:66
Dtk_Entity::info
Dtk_InfoPtr & info()
sampleWriter::Loop4_EFGH
@ Loop4_EFGH
Definition: testcreatecube.cpp:67
sampleWriter::Loop2_FBDG
@ Loop2_FBDG
Definition: testcreatecube.cpp:65
sampleWriter::Edge_HG
@ Edge_HG
Definition: testcreatecube.cpp:37
Dtk_CylindricalSurface::Create
static Dtk_CylindricalSurfacePtr Create(const Dtk_pnt &inOrigin, const Dtk_dir &inNormal, const Dtk_dir &inUDirection, const Dtk_Double64 &inRadius, const Dtk_dir &inYDirection=Dtk_dir())
Create an infinite cylinder.