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

Function Documentation

◆ CreateAxis()

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

◆ CreateAxisSystem()

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

◆ CreateConstructionPlane()

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

◆ CreateCube()

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

◆ CreateCube_2()

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

◆ CreateCubeRenderInfos()

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

◆ CreateCurves()

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

◆ CreateCurves_2()

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

◆ CreateCurvesStyle()

Dtk_BodyPtr sampleWriter::CreateCurvesStyle ( )
1435  {
1436  Dtk_tab<Dtk_CurvePtr> mycurves;
1437  Dtk_BodyPtr mybody;
1438  mybody = Dtk_Body::Create();
1439  Dtk_ShellPtr myshell;
1440  myshell = Dtk_Shell::Create( mybody );
1441 
1442  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 );
1443  ellipsethick->info() = Dtk_Info::create();
1444  ellipsethick->info()->SetColor( Dtk_RGB( 255, 0, 0 ) );
1445  ellipsethick->info()->SetCurveThickNessInMM( 4 );
1446  mycurves.push_back( Dtk_CurvePtr::DtkDynamicCast( ellipsethick ) );
1447 
1448 
1449  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 );
1450  ellipsedash->info() = Dtk_Info::create();
1451  ellipsedash->info()->SetColor( Dtk_RGB( 0, 0, 255 ) );
1452  ellipsedash->info()->SetCurveLineType( DTK_DASHED );
1453  mycurves.push_back( Dtk_CurvePtr::DtkDynamicCast( ellipsedash ) );
1454 
1455  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 );
1456  ellipsedotted->info() = Dtk_Info::create();
1457  ellipsedotted->info()->SetColor( Dtk_RGB( 255, 0, 255 ) );
1458  ellipsedotted->info()->SetCurveLineType( DTK_DOTTED );
1459  ellipsedotted->info()->SetCurveThickNessInMM( 2 );
1460  mycurves.push_back( Dtk_CurvePtr::DtkDynamicCast( ellipsedotted ) );
1461 
1462  myshell->AddWire( mycurves );
1463  mybody->AddWireShell( myshell );
1464  mybody->info() = Dtk_Info::create();
1465 
1466  return mybody;
1467  }

◆ CreateCyl()

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

◆ CreateCylinder()

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

◆ CreateDimension()

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

◆ CreateEsquisse2D()

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

◆ CreateEsquisse3D()

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

◆ CreateFdtDatum()

Dtk_FdtPtr sampleWriter::CreateFdtDatum ( )

Creates simple Datum.

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

◆ CreateGeometricalTolerance()

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

◆ CreateInfinitePlane()

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

◆ CreateMeshCube()

Dtk_MeshPtr sampleWriter::CreateMeshCube ( )

Mesh Cube sample.

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

◆ CreateMeshCubeVertexColor()

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

◆ CreateMeshCuboid()

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

◆ CreateMeshCylinder()

Dtk_MeshPtr sampleWriter::CreateMeshCylinder ( int  nbpoints)

Mesh Cylinder sample.

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

◆ CreateMeshPoints()

Dtk_MeshPtr sampleWriter::CreateMeshPoints ( )

Points mesh sample.

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

◆ CreateMeshWire()

Dtk_MeshPtr sampleWriter::CreateMeshWire ( )

Wire mesh sample.

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

◆ CreateMixedBody()

Dtk_BodyPtr sampleWriter::CreateMixedBody ( )
1817  {
1818  Dtk_BodyPtr body = CreateCube();
1819 
1820  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 );
1821  Dtk_Double64 domain[] = { 0.0,6.0,0.0,100.0 };
1822  cyl->SetTrimUVBox( domain );
1823  cyl->info() = Dtk_Info::create();
1824  cyl->info()->SetColor( Dtk_RGB( 255, 0, 0 ) );
1825  body->AddUnboundedFace( Dtk_SurfacePtr::DtkDynamicCast( cyl ) );
1826 
1827 
1828  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 );
1829  Dtk_Double64 domain2[] = { 0.0,3.14,-50.0,50.0 };
1830  cyl->SetTrimUVBox( domain2 );
1831  cyl->info() = Dtk_Info::create();
1832  cyl->info()->SetColor( Dtk_RGB( 0, 255, 0 ) );
1833  body->AddUnboundedFace( Dtk_SurfacePtr::DtkDynamicCast( cyl ) );
1834 
1835  return body;
1836  }

◆ CreateModelDisplayActivated()

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

◆ CreateModelDisplayDesactivated()

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

◆ CreateModelDisplayWithSection()

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

◆ CreateOpenShell()

Dtk_BodyPtr sampleWriter::CreateOpenShell ( )
1344  {
1345  Dtk_BodyPtr body = Dtk_Body::Create(); // create the Body
1346  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 );
1347  Dtk_Double64 domain[] = { 0.0,3.14,-5.0,5.0 };
1348  cyl->SetTrimUVBox( domain );
1349  body->AddUnboundedFace( Dtk_SurfacePtr::DtkDynamicCast( cyl ) );
1350 
1351  //For an open shell you can also create an OpenShell and call
1352  //body->AddOpenShell(shell);
1353 
1354  return body;
1355  }

◆ CreateOpenShell_2()

Dtk_BodyPtr sampleWriter::CreateOpenShell_2 ( )
1095  {
1096  Dtk_BodyPtr body = Dtk_Body::Create(); // create the Body
1097  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 );
1098  Dtk_Double64 domain[] = { 0.0,3.14,-5.0,5.0 };
1099  cyl->SetTrimUVBox( domain );
1100  body->AddUnboundedFace( Dtk_SurfacePtr::DtkDynamicCast( cyl ) );
1101 
1102  //For an open shell you can also create an OpenShell and call
1103  //body->AddOpenShell(shell);
1104 
1105  return body;
1106  }

◆ CreatePoint()

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

◆ CreateTexturedMeshCube()

Dtk_MeshPtr sampleWriter::CreateTexturedMeshCube ( const Dtk_string inImageDirectory)

Textured Mesh Cube sample.

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

◆ FillFacesColors()

void sampleWriter::FillFacesColors ( Dtk_MeshPtr inoutCubeMesh)

Filling mesh faces with colors.

242  {
243  Dtk_InfoPtr infoFace0 = Dtk_Info::create();
244  infoFace0->SetColor( Dtk_RGB( 255, 1, 0 ) );
245  inoutCubeMesh->get_mesh_face( 0 )->info() = infoFace0;
246 
247  Dtk_InfoPtr infoFace1 = Dtk_Info::create();
248  infoFace1->SetColor( Dtk_RGB( 0, 255, 0 ) );
249  inoutCubeMesh->get_mesh_face( 1 )->info() = infoFace1;
250 
251  Dtk_InfoPtr infoFace2 = Dtk_Info::create();
252  infoFace2->SetColor( Dtk_RGB( 0, 0, 255 ) );
253  inoutCubeMesh->get_mesh_face( 2 )->info() = infoFace2;
254 
255  Dtk_InfoPtr infoFace3 = Dtk_Info::create();
256  infoFace3->SetColor( Dtk_RGB( 255, 255, 0 ) );
257  inoutCubeMesh->get_mesh_face( 3 )->info() = infoFace3;
258 
259  Dtk_InfoPtr infoFace4 = Dtk_Info::create();
260  infoFace4->SetColor( Dtk_RGB( 0, 255, 255 ) );
261  inoutCubeMesh->get_mesh_face( 4 )->info() = infoFace4;
262 
263  Dtk_InfoPtr infoFace5 = Dtk_Info::create();
264  infoFace5->SetColor( Dtk_RGB( 255, 128, 0 ) );
265  inoutCubeMesh->get_mesh_face( 5 )->info() = infoFace5;
266  }
sampleWriter::Coedge0_DC
@ Coedge0_DC
Definition: testcreatecube.cpp:39
sampleWriter::Coedge3_HC
@ Coedge3_HC
Definition: testcreatecube.cpp:53
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:64
Dtk_pair
Definition: util_stl_dtk.hpp:921
DTK_MESH_NORMAL
#define DTK_MESH_NORMAL
Definition: util_mesh_dtk.hpp:31
sampleWriter::Edge_GD
@ Edge_GD
Definition: testcreatecube.cpp:30
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:49
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:15
Dtk_Info::SetName
Dtk_ErrorStatus SetName(Dtk_string inName)
sampleWriter::Edge_FB
@ Edge_FB
Definition: testcreatecube.cpp:28
sampleWriter::CreateMeshCube
Dtk_MeshPtr CreateMeshCube()
Mesh Cube sample.
Definition: testcreatemesh.cpp:204
Dtk_TextStyle
This is the text_style. This class gathers information about text style.
Definition: util_draw_dtk.hpp:250
sampleWriter::Coedge5_CA
@ Coedge5_CA
Definition: testcreatecube.cpp:38
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:14
sampleWriter::Edge_FE
@ Edge_FE
Definition: testcreatecube.cpp:29
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:56
sampleWriter::Coedge5_EH
@ Coedge5_EH
Definition: testcreatecube.cpp:58
DTK_TRUE
#define DTK_TRUE
Definition: define.h:730
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:691
Dtk_string
This is a high level string class.
Definition: dtk_string.hpp:53
DTK_ANCHOR_BOTTOM_LEFT
@ DTK_ANCHOR_BOTTOM_LEFT
Definition: util_draw_dtk.hpp:97
Dtk_Size_t
size_t Dtk_Size_t
Definition: define.h:715
sampleWriter::Volume
@ Volume
Definition: testcreatecube.cpp:13
sampleWriter::Coedge4_GF
@ Coedge4_GF
Definition: testcreatecube.cpp:52
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:26
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
sampleWriter::Edge_HC
@ Edge_HC
Definition: testcreatecube.cpp:32
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:44
sampleWriter::Coedge3_HG
@ Coedge3_HG
Definition: testcreatecube.cpp:55
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:731
Dtk_Face::AddOuterLoop
Dtk_ErrorStatus AddOuterLoop(const Dtk_LoopPtr &inLoop)
Add outer loop on a face.
sampleWriter::Edge_CA
@ Edge_CA
Definition: testcreatecube.cpp:24
sampleWriter::Coedge0_BD
@ Coedge0_BD
Definition: testcreatecube.cpp:41
Dtk_bool
char Dtk_bool
Definition: define.h:728
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:95
sampleWriter::Coedge2_GF
@ Coedge2_GF
Definition: testcreatecube.cpp:51
sampleWriter::Edge_EH
@ Edge_EH
Definition: testcreatecube.cpp:34
Dtk_Double64
double Dtk_Double64
Definition: define.h:702
sampleWriter::Vertex_H
@ Vertex_H
Definition: testcreatecube.cpp:22
Dtk_transfo::setXdir
void setXdir(const Dtk_dir &X)
Set a new X vector.
sampleWriter::Coedge2_FB
@ Coedge2_FB
Definition: testcreatecube.cpp:46
Dtk_mesh
This is a high level mesh class.
Definition: util_mesh_dtk.hpp:485
Dtk_Dimension::DistanceDimension
@ DistanceDimension
Definition: util_draw_dtk.hpp:4739
Dtk_pair::first
T1 first
Definition: util_stl_dtk.hpp:923
Dtk_TextStyle::CharWidth
Dtk_Double64 & CharWidth()
Retrieves the char width - get/set -.
sampleWriter::FaceABCD
@ FaceABCD
Definition: testcreatecube.cpp:65
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:21
sampleWriter::Coedge4_FE
@ Coedge4_FE
Definition: testcreatecube.cpp:50
DTK_MESH_RGB
#define DTK_MESH_RGB
Definition: util_mesh_dtk.hpp:32
DTK_DASHED
@ DTK_DASHED
Definition: util_ent_dtk.hpp:49
sampleWriter::Loop0_ABCD
@ Loop0_ABCD
Definition: testcreatecube.cpp:59
sampleWriter::FaceABFE
@ FaceABFE
Definition: testcreatecube.cpp:66
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:68
sampleWriter::Coedge3_DC
@ Coedge3_DC
Definition: testcreatecube.cpp:40
sampleWriter::Vertex_B
@ Vertex_B
Definition: testcreatecube.cpp:16
sampleWriter::FaceEFGH
@ FaceEFGH
Definition: testcreatecube.cpp:69
Dtk_ReferenceFrame::Create
static Dtk_ReferenceFramePtr Create()
Calls default constructor to allocate a new object.
sampleWriter::Edge_EA
@ Edge_EA
Definition: testcreatecube.cpp:27
sampleWriter::Edge_AB
@ Edge_AB
Definition: testcreatecube.cpp:23
Dtk_anchor_type
Dtk_anchor_type
Definition: util_draw_dtk.hpp:90
sampleWriter::Edge_GF
@ Edge_GF
Definition: testcreatecube.cpp:31
DTK_Text_type
DTK_Text_type
Definition: str_def.h:11
Dtk_Int32
int32_t Dtk_Int32
Definition: define.h:690
Dtk_tab::resize
void resize(Dtk_Size_t n, const T &t)
Resizes the array.
Definition: util_stl_dtk.hpp:604
DTK_DOTTED
@ DTK_DOTTED
Definition: util_ent_dtk.hpp:55
Dtk_Symbol::TypeDatum
@ TypeDatum
Definition: util_draw_dtk.hpp:6362
sampleWriter::Coedge2_GD
@ Coedge2_GD
Definition: testcreatecube.cpp:48
sampleWriter::Loop1_ABFE
@ Loop1_ABFE
Definition: testcreatecube.cpp:60
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:4719
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:18
Dtk_mesh_face::add_point
int add_point(Dtk_UInt32 inpnt)
Dtk_pair::second
T2 second
Definition: util_stl_dtk.hpp:924
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:45
sampleWriter::Vertex_C
@ Vertex_C
Definition: testcreatecube.cpp:17
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_Face::SetGeom
void SetGeom(const Dtk_SurfacePtr &inSurface)
Set Geometry.
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:67
sampleWriter::Lump
@ Lump
Definition: testcreatecube.cpp:12
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:43
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:20
sampleWriter::Coedge4_EH
@ Coedge4_EH
Definition: testcreatecube.cpp:57
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
sampleWriter::Coedge2_BD
@ Coedge2_BD
Definition: testcreatecube.cpp:42
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:320
Dtk_Leader::TerminatorTypeClosedArrow
@ TerminatorTypeClosedArrow
Definition: util_draw_dtk.hpp:1961
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:84
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:1316
Dtk_tab::size
Dtk_Size_t size() const
Returns the size of the array.
Definition: util_stl_dtk.hpp:503
sampleWriter::FaceEHCA
@ FaceEHCA
Definition: testcreatecube.cpp:70
sampleWriter::Vertex_F
@ Vertex_F
Definition: testcreatecube.cpp:20
sampleWriter::Coedge5_HC
@ Coedge5_HC
Definition: testcreatecube.cpp:54
sampleWriter::Coedge1_AB
@ Coedge1_AB
Definition: testcreatecube.cpp:36
sampleWriter::Coedge0_AB
@ Coedge0_AB
Definition: testcreatecube.cpp:35
Dtk_Leader::LeaderTerminatorTypeEnum
LeaderTerminatorTypeEnum
Internal leader terminator type.
Definition: util_draw_dtk.hpp:1955
Dtk_tab::at
T & at(Dtk_Size_t k)
Definition: util_stl_dtk.hpp:397
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.
DTK_FRAME_TYPE_RECTANGLE
@ DTK_FRAME_TYPE_RECTANGLE
Definition: util_draw_dtk.hpp:127
sampleWriter::Coedge0_CA
@ Coedge0_CA
Definition: testcreatecube.cpp:37
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:352
Dtk_CompositeText::AddText
void AddText(Dtk_Text inText)
Adds a Dtk_Text to the Dtk_CompositeText.
sampleWriter::Edge_DC
@ Edge_DC
Definition: testcreatecube.cpp:25
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:468
sampleWriter::Coedge1_FE
@ Coedge1_FE
Definition: testcreatecube.cpp:47
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:14
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:19
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:6076
DTK_PI
#define DTK_PI
Definition: str_def.h:8
sampleWriter::Loop3_GDCH
@ Loop3_GDCH
Definition: testcreatecube.cpp:62
Dtk_Entity::info
Dtk_InfoPtr & info()
sampleWriter::Loop4_EFGH
@ Loop4_EFGH
Definition: testcreatecube.cpp:63
sampleWriter::Loop2_FBDG
@ Loop2_FBDG
Definition: testcreatecube.cpp:61
sampleWriter::Edge_HG
@ Edge_HG
Definition: testcreatecube.cpp:33
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.