 |
DATAKIT API
V2025.4
|
|
|
| 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
} |
| |
◆ 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 | |
◆ CreateAxis()
1562 mybody->get_info()->SetInfiniteGeometryFlag(
DTK_TRUE );
1563 mybody->get_info()->SetRefEntityFlag(
DTK_TRUE );
1568 lineptr->info()->SetColor(
Dtk_RGB( 0, 255, 25, 255 ) );
1569 lineptr->info()->SetName( L
"myaxe" );
1574 ArrayMetadataEntity.
push_back( metadata );
1575 lineptr->info()->SetMetaData( ArrayMetadataEntity );
1579 shell->AddWire( CurveArray );
1580 mybody->AddWireShell( shell );
◆ CreateAxisSystem()
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 );
1537 mycsystem->SetMatrix( dtk_transfo );
1539 mycsystem->info()->SetName( L
"mycsystem" );
1540 mycsystem->info()->SetColor(
Dtk_RGB( 255, 0, 0, 255 ) );
1541 mycsystem->info()->SetLayer( 123 );
1546 ArrayMetadataEntity.
push_back( metadata );
1547 mycsystem->info()->SetMetaData( ArrayMetadataEntity );
◆ CreateConstructionPlane()
1169 body->AddOpenShell( shell );
1171 body->info()->SetName(
"Plane Y=50" );
◆ CreateCube()
1322 std::map<Dtk_ID, Dtk_EntityPtr> array_topo;
1326 body->info()->SetName( L
"Body" );
1330 ArrayMetadataEntity.
push_back( metadata );
1331 body->info()->SetMetaData( ArrayMetadataEntity );
1333 CreateTopoVertex( array_topo, body );
1334 CreateTopoEdge( array_topo, body );
1335 CreateTopoCoEdge( array_topo, body );
1336 CreateTopoLoop( array_topo, body );
1337 CreateTopoFace( array_topo, body );
1338 CreateTopoShell( array_topo, body );
1339 CreateTopoVolume( array_topo, body );
1340 CreateTopoLump( array_topo, body );
◆ CreateCube_2()
1072 std::map<Dtk_ID, Dtk_EntityPtr> array_topo;
1076 CreateTopoVertex_2( array_topo, body );
1077 CreateTopoEdge_2( array_topo, body );
1078 CreateTopoCoEdge_2( array_topo, body );
1079 CreateTopoLoop_2( array_topo, body );
1080 CreateTopoFace_2( array_topo, body );
1081 CreateTopoShell_2( array_topo, body );
1082 CreateTopoVolume_2( array_topo, body );
1083 CreateTopoLump_2( array_topo, body );
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 );
1095 body_info->
AddAttribute(
"geometric validation property : : centre point", valprop_CG );
◆ CreateCubeRenderInfos()
511 ambiant.
SetRGBA( 255, 255, 255 );
512 diffuse.
SetRGBA( 255, 255, 255 );
513 specular.
SetRGBA( 255, 255, 255 );
519 fileName =
"..\\InputImages\\sample.bmp";
520 texture->SetImagePath( fileName );
522 texture->SetScale( 2, 2 );
◆ CreateCurves()
1376 mycurve->info()->SetColor(
Dtk_RGB( 255, 0, 255 ) );
1377 mycurve->info()->SetName(
"mycircle" );
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 );
1385 mycurve->info()->SetColor(
Dtk_RGB( 255, 255, 0 ) );
1386 mycurve->info()->SetName(
"myellipse" );
1395 mycurve->info()->SetColor(
Dtk_RGB( 0, 0, 255 ) );
1396 mycurve->info()->SetName(
"myline" );
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. );
1412 Knots[ 0 ] = Knots[ 1 ] = Knots[ 2 ] = Knots[ 3 ] = 0.0;
1413 Knots[ 4 ] = Knots[ 5 ] = Knots[ 6 ] = Knots[ 7 ] = 1.0;
1418 mycurve->info()->SetColor(
Dtk_RGB( 0, 255, 0 ) );
1419 mycurve->info()->SetName(
"mynurbs" );
1424 myshell->AddWire( mycurves );
1425 mybody->AddWireShell( myshell );
1430 ArrayMetadataEntity.
push_back( metadata );
1433 mybody->info()->SetMetaData( ArrayMetadataEntity );
◆ CreateCurves_2()
1130 mycurve->info()->SetColor(
Dtk_RGB( 255, 0, 255 ) );
1131 mycurve->info()->SetName(
"mycircle" );
1140 mycurve->info()->SetColor(
Dtk_RGB( 0, 0, 255 ) );
1141 mycurve->info()->SetName(
"myline" );
1145 myshell->AddWire( mycurves );
1146 mysbody->AddWireShell( myshell );
1151 Dtk_Val valprop_curve_length(
"1234 mm" );
1152 body_info->
AddAttribute(
"geometric validation property : : curve length measure", valprop_curve_length );
◆ CreateCurvesStyle()
1448 ellipsethick->info()->SetColor(
Dtk_RGB( 255, 0, 0 ) );
1449 ellipsethick->info()->SetCurveThickNessInMM( 4 );
1455 ellipsedash->info()->SetColor(
Dtk_RGB( 0, 0, 255 ) );
1456 ellipsedash->info()->SetCurveLineType(
DTK_DASHED );
1461 ellipsedotted->info()->SetColor(
Dtk_RGB( 255, 0, 255 ) );
1462 ellipsedotted->info()->SetCurveLineType(
DTK_DOTTED );
1463 ellipsedotted->info()->SetCurveThickNessInMM( 2 );
1466 myshell->AddWire( mycurves );
1467 mybody->AddWireShell( myshell );
◆ CreateCyl()
| Dtk_BodyPtr sampleWriter::CreateCyl |
( |
double |
radius, |
|
|
double |
height |
|
) |
| |
1760 body->AddLump( lump );
1761 lump->AddVolume( volume );
1762 volume->AddOuterShell( shell );
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 );
1771 for( i = 0; i < 4; i++ )
1772 v[ i ] = MakeVertex( body, P[ i ] );
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 );
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 ) ),
1785 MakeCoedge( body, e[ 2 ],
DTK_TRUE, MakeSegment2D( -
DTK_PI, 0, 0, 0 ) )
1788 FillInfos( half1->info(), 1,
Dtk_RGB() );
1791 MakeCoedge( body, e[ 3 ],
DTK_TRUE, MakeSegment2D( 0, 0,
DTK_PI, 0 ) ),
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 ) )
1797 FillInfos( half2->info(), 2,
Dtk_RGB() );
1804 shell->AddFace( plandown,
DTK_TRUE );
1805 FillInfos( plandown->info(), 3,
Dtk_RGB() );
1812 shell->AddFace( planup,
DTK_TRUE );
1813 FillInfos( planup->info(), 4,
Dtk_RGB( 0, 255, 0 ) );
◆ CreateCylinder()
1193 Dtk_pnt cent1( 0., 0., 100. );
1202 trim[ 0 ] = -100.; trim[ 1 ] = 100.; trim[ 2 ] = -100.; trim[ 3 ] = 100.;
1203 plan1->SetTrimUVBox( trim );
1205 plan2->SetTrimUVBox( trim );
1207 trim[ 0 ] = 0.; trim[ 1 ] = 2. *
DTK_PI;
1208 cylsurf->SetTrimUVBox( trim );
1219 E0->SetStartVertex( V1 );
1220 E0->SetEndVertex( V2 );
1223 E1->SetStartVertex( V1 );
1224 E1->SetEndVertex( V1 );
1227 E2->SetStartVertex( V2 );
1228 E2->SetEndVertex( V2 );
1233 SetTopoFaceID( F0, 10 );
1236 SetTopoFaceID( F1, 20 );
1238 F1->info()->SetColor(
Dtk_RGB( 255, 0, 0 ) );
1241 SetTopoFaceID( F2, 30 );
1256 F0->AddOuterLoop( L0 );
1262 F1->AddOuterLoop( L1 );
1268 F2->AddOuterLoop( L2 );
1276 VOL->AddOuterShell( SH );
1278 Lump->AddVolume( VOL );
1279 mysbody->AddLump(
Lump );
1281 mysbody->info()->SetColor(
Dtk_RGB( 0, 255, 0 ) );
◆ CreateDimension()
127 Dtk_bool horiz_vert = 0, mirror = 0, font_index = 0;
135 text_style.
Slant() = slant;
141 double x_len = 15., y_len = 5.;
142 Dtk_dir x_dir( 1., 0., 0. ), y_dir( 0., 0., 1. );
159 Dtk_Text dtk_text( str, inbox, inbox, dtk_align, text_type, horiz_vert, text_info, text_style, slant, font_index, mirror );
173 double arrow_width = 5., arrow_length = 5.;
190 dimension->AddLeader( leader1 );
206 dimension->AddLeader( leader2 );
211 fdt_transf.
setXdir( 0., 1., 0. );
212 fdt_transf.
setYdir( -1., 0., 0. );
213 fdt->Transform( fdt_transf );
217 fdt_info->
SetName(
"Dimension:1" );
218 fdt->info() = fdt_info;
222 ArrayMetadataEntity.
push_back( metadata );
223 fdt->info()->SetMetaData( ArrayMetadataEntity );
◆ CreateEsquisse2D()
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 );
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 );
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 );
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 );
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 );
1732 myshell->AddWire( ArrayPoint );
1733 myshell->AddWire( ArrayCurve );
1735 mybody->AddWireShell( myshell );
1738 mybody->info()->SetColor(
Dtk_RGB( 255, 0, 0 ) );
1739 mybody->info()->SetName( L
"CreateEsquisse2D" );
1744 mybody->Transform( transfo );
1748 ArrayMetadataEntity.
push_back( metadata );
1749 mybody->info()->SetMetaData( ArrayMetadataEntity );
◆ CreateEsquisse3D()
1605 mypoint->info()->SetColor(
Dtk_RGB( 255, 0, 0 ) );
1607 name.add_int( (
int )i );
1608 mypoint->info()->SetName( name );
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 );
1637 for(
Dtk_Size_t i = 0; i < NbArcCircle; i++ )
1642 myellipse->SetTrimmingParameters( 0.0,
DTK_PI );
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 );
1653 for(
Dtk_Size_t i = 0; i < NbArcEllipse; i++ )
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 );
1667 myshell->AddWire( ArrayPoint );
1668 myshell->AddWire( ArrayCurve );
1670 mybody->AddWireShell( myshell );
1673 mybody->info()->SetColor(
Dtk_RGB( 255, 0, 0 ) );
1674 mybody->info()->SetName( L
"CreateEsquisse3D" );
1678 ArrayMetadataEntity.
push_back( metadata );
1679 mybody->info()->SetMetaData( ArrayMetadataEntity );
◆ CreateFdtDatum()
Creates simple Datum.
24 Dtk_pnt arrow_location( 0., 0. );
37 Dtk_bool horiz_vert = 0, mirror = 0, font_index = 0;
45 text_style.
Slant() = slant;
51 double XLen = 5., YLen = 5.;
52 Dtk_dir XDir( 1., 0., 0. ), YDir( 0., 0., 1. );
69 Dtk_Text dtk_text( str, inbox, inbox, dtk_align, text_type, horiz_vert, text_info, text_style, slant, font_index, mirror );
79 framePolyline->AddPoint(
Dtk_pnt( 5., 28. ) );
80 framePolyline->AddPoint(
Dtk_pnt( -5., 28. ) );
81 framePolyline->AddPoint(
Dtk_pnt( -5., 18. ) );
88 leader_info->
SetColor( 255, 255, 255 );
89 leader->GetInfo() = leader_info;
91 symbol->AddLeader( leader );
100 fdt->Transform( fdt_transf );
104 fdt_info->
SetColor( 255, 255, 255 );
105 fdt_info->
SetName(
"Datum:1" );
106 fdt->info() = fdt_info;
110 ArrayMetadataEntity.
push_back( metadata );
111 fdt->info()->SetMetaData( ArrayMetadataEntity );
◆ CreateGeometricalTolerance()
| Dtk_FdtPtr sampleWriter::CreateGeometricalTolerance |
( |
| ) |
|
236 Dtk_bool horiz_vert = 0, mirror = 0, font_index = 0;
239 Dtk_dir x_dir( 1, 0, 0 ), normal_dir( 0, 0, 1 );
245 text_style.
Slant() = slant;
252 Dtk_pnt location_c( 0.0, 0.0 );
255 container_boxin.
Extend( -2., -2. );
266 MyGeometricalTolerance->AddToleranceSpecificationContainer( MyContainer );
274 Dtk_pnt location_v( 15.0, 0.0 );
277 container_boxvin.
Extend( -2., -2. );
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 );
284 Dtk_pnt locationm( 35.0, 0.0 );
287 container_boxmin.
Extend( -2., -2. );
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 );
296 Dtk_pnt locationA( 50.0, 0.0 );
299 container_boxAin.
Extend( -2., -2. );
303 A_Block->AddReference( L
"A" );
304 RefFrame->AddReferenceBlock( A_Block );
308 MyToleranceSpecification->SetMainValue( fulltext );
311 MyContainer->AddToleranceSpecification( MyToleranceSpecification );
317 fdt_info->
SetColor( 255, 255, 255 );
318 fdt_info->
SetName(
"GeometricalTolerance" );
319 fdt->info() = fdt_info;
◆ CreateInfinitePlane()
1504 mybody->info()->SetInfiniteGeometryFlag(
DTK_TRUE );
1505 mybody->get_info()->SetRefEntityFlag(
DTK_TRUE );
1507 mybody->info()->SetColor(
Dtk_RGB( 255, 0, 0, 255 ) );
1508 mybody->info()->SetName( L
"myplan" );
1512 ArrayMetadataEntity.
push_back( metadata );
1513 mybody->info()->SetMetaData( ArrayMetadataEntity );
1522 plane->SetTrimUVBox( dom );
◆ CreateMeshCube()
Mesh Cube sample.
222 CreateMeshCubeGeometry( vertices, normals, uCoords, vCoords );
229 outCubeMesh->
add_vertex( &( vertices.
at( i ) ), &( normals.
at( i ) ), NULL, uCoords[ i ], vCoords[ i ] );
235 CreateMeshCubeFaces( outCubeMesh );
◆ CreateMeshCubeVertexColor()
| Dtk_MeshPtr sampleWriter::CreateMeshCubeVertexColor |
( |
| ) |
|
317 CreateMeshCubeGeometry( vertices, normals, uCoords, vCoords );
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 );
333 CreateMeshCubeFaces( outCubeMesh );
◆ CreateMeshCuboid()
473 inPoints.
first = inFirstPoint;
474 inPoints.
second = inSecondPoint;
477 CreateMeshCubeidGeometry( vertices, normals, uCoords, vCoords, inPoints );
483 outCuboidMesh->
add_vertex( &( vertices.
at( i ) ), &( normals.
at( i ) ), NULL, uCoords[ i ], vCoords[ i ] );
489 CreateMeshCubeFaces( outCuboidMesh );
496 return outCuboidMesh;
◆ CreateMeshCylinder()
| Dtk_MeshPtr sampleWriter::CreateMeshCylinder |
( |
int |
nbpoints | ) |
|
Mesh Cylinder sample.
360 double angle = i * 2 *
DTK_PI / nbpoints;
375 Dtk_RGB rgb( 255, 255, 0, 128 );
383 ArrayMetadataEntity.
push_back( metadata );
386 return outCylinderMesh;
◆ CreateMeshPoints()
Points mesh sample.
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} };
450 for( i = 0; i < 8; i++ )
452 Dtk_pnt P( coords[ i ][ 0 ], coords[ i ][ 1 ], coords[ i ][ 2 ] );
◆ CreateMeshWire()
Wire mesh sample.
411 numVertices = vertices.
size();
412 for( i = 0; i < numVertices; i++ )
◆ CreateMixedBody()
1826 cyl->SetTrimUVBox( domain );
1828 cyl->info()->SetColor(
Dtk_RGB( 255, 0, 0 ) );
1834 cyl->SetTrimUVBox( domain2 );
1836 cyl->info()->SetColor(
Dtk_RGB( 0, 255, 0 ) );
◆ CreateModelDisplayActivated()
333 resMD->info()->SetName(
"MyView1" );
◆ CreateModelDisplayDesactivated()
346 resMD->info()->SetName(
"MyView2" );
◆ CreateModelDisplayWithSection()
357 resMD->info()->SetName(
"MySectionView" );
◆ CreateOpenShell()
1352 cyl->SetTrimUVBox( domain );
◆ CreateOpenShell_2()
1105 cyl->SetTrimUVBox( domain );
◆ CreatePoint()
1485 mypoint->info()->SetColor(
Dtk_RGB( 255, 0, 0 ) );
1486 mypoint->info()->SetName(
"mypoint" );
1490 ArrayMetadataEntity.
push_back( metadata );
1491 mypoint->info()->SetMetaData( ArrayMetadataEntity );
1495 myshell->AddWire( mypoints );
1496 mybody->AddWireShell( myshell );
◆ CreateTexturedMeshCube()
Textured Mesh Cube sample.
282 meshTexture->SetImagePath( inImageDirectory +
"sample.bmp" );
283 meshTexture->SetScale( 2., 2. );
285 outCubeMesh->info()->AddRenderInfos( meshRender );
286 outCubeMesh->info()->SetName(
"TexturedMesh" );
291 faceTexture->SetImagePath( inImageDirectory +
"logodtk.bmp" );
292 faceTexture->SetScale( 2., 2. );
294 if( outCubeMesh->get_mesh_face( 2 )->info().
IsNULL() )
296 outCubeMesh->get_mesh_face( 2 )->info()->AddRenderInfos( faceRender );
◆ FillFacesColors()
| void sampleWriter::FillFacesColors |
( |
Dtk_MeshPtr & |
inoutCubeMesh | ) |
|
Filling mesh faces with colors.
250 inoutCubeMesh->get_mesh_face( 0 )->info() = infoFace0;
254 inoutCubeMesh->get_mesh_face( 1 )->info() = infoFace1;
258 inoutCubeMesh->get_mesh_face( 2 )->info() = infoFace2;
262 inoutCubeMesh->get_mesh_face( 3 )->info() = infoFace3;
266 inoutCubeMesh->get_mesh_face( 4 )->info() = infoFace4;
270 inoutCubeMesh->get_mesh_face( 5 )->info() = infoFace5;
@ Coedge0_DC
Definition: testcreatecube.cpp:43
@ Coedge3_HC
Definition: testcreatecube.cpp:57
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.
static Dtk_ToleranceSpecificationPtr Create()
Calls default constructor to allocate a new object.
@ Loop5_EHCA
Definition: testcreatecube.cpp:68
Definition: util_stl_dtk.hpp:919
#define DTK_MESH_NORMAL
Definition: util_mesh_dtk.hpp:31
@ Edge_GD
Definition: testcreatecube.cpp:34
This is the Transformation dedicated class.
Definition: dtk_transfo.hpp:19
This is a high level face class.
Definition: util_mesh_dtk.hpp:865
void SetRGBA(const int &inRed, const int &inGreen, const int &inBlue, const int &inAlpha=-1)
Definition: dtk_rgb.hpp:49
static Dtk_TextureInfosPtr Create(const TextureMappingTypeEnum &inType)
Create a Dtk_TextureInfosPtr.
@ Coedge3_GD
Definition: testcreatecube.cpp:53
Dtk_ErrorStatus AddAttribute(Dtk_string name, Dtk_Val val)
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.
@ Vertex_A
Definition: testcreatecube.cpp:19
Dtk_ErrorStatus SetName(Dtk_string inName)
@ Edge_FB
Definition: testcreatecube.cpp:32
Dtk_MeshPtr CreateMeshCube()
Mesh Cube sample.
Definition: testcreatemesh.cpp:209
This is the text_style. This class gathers information about text style.
Definition: util_draw_dtk.hpp:253
@ Coedge5_CA
Definition: testcreatecube.cpp:42
void setOrigin(const Dtk_pnt &O)
Set a new O center point.
void setZdir(const Dtk_dir &Z)
Set a new Z vector.
@ Shell
Definition: testcreatecube.cpp:18
@ Edge_FE
Definition: testcreatecube.cpp:33
static Dtk_LoopPtr Create(const Dtk_BodyPtr &inParentBody)
Create a loop in a body.
@ Coedge4_HG
Definition: testcreatecube.cpp:60
@ Coedge5_EH
Definition: testcreatecube.cpp:62
#define DTK_TRUE
Definition: define.h:729
static Dtk_ToleranceSpecificationContainerPtr Create(const Dtk_ToleranceSpecificationContainer &in)
Calls copy constructor to allocate a new object.
@ dtk_text_type_value
Definition: str_def.h:14
uint32_t Dtk_UInt32
Definition: define.h:690
This is a high level string class.
Definition: dtk_string.hpp:58
@ DTK_ANCHOR_BOTTOM_LEFT
Definition: util_draw_dtk.hpp:100
size_t Dtk_Size_t
Definition: define.h:714
@ Volume
Definition: testcreatecube.cpp:17
@ Coedge4_GF
Definition: testcreatecube.cpp:56
int add_triangle_strip(const Dtk_tab< Dtk_UInt32 > *inIndices)
Add one triangle strip.
@ Edge_BD
Definition: testcreatecube.cpp:30
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
@ Edge_HC
Definition: testcreatecube.cpp:36
static Dtk_RenderInfosPtr Create(const Dtk_string &inName)
Create a Dtk_RenderInfosPtr.
static Dtk_SmartPtr< Dtk_AxisSystem > create()
Calls default constructor to allocate a new object.
Dtk_ErrorStatus SetMetaData(Dtk_tab< Dtk_MetaDataPtr > &inArray)
@ Coedge5_EA
Definition: testcreatecube.cpp:48
@ Coedge3_HG
Definition: testcreatecube.cpp:59
static Dtk_BodyPtr Create()
Create a body.
#define DTK_MESH_XYZ
Definition: util_mesh_dtk.hpp:30
static Dtk_LightMapPtr Create(Dtk_RGB inAmbiant, Dtk_RGB inDiffuse, Dtk_RGB inSpecular)
Create a Dtk_LightMapPtr.
#define DTK_FALSE
Definition: define.h:730
@ Edge_CA
Definition: testcreatecube.cpp:28
@ Coedge0_BD
Definition: testcreatecube.cpp:45
char Dtk_bool
Definition: define.h:727
Dtk_Double64 & Slant()
Retrieves the text slant - get/set -.
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.
void SetTexture(const Dtk_TextureInfosPtr &inTexture)
Set Dtk_Texture.
static Dtk_SymbolPtr Create()
Calls default constructor to allocate a new object.
#define DTK_MESH_UV_TEXTURES
Definition: util_mesh_dtk.hpp:33
@ DTK_ANCHOR_MIDDLE_CENTER
Definition: util_draw_dtk.hpp:98
@ Coedge2_GF
Definition: testcreatecube.cpp:55
@ Edge_EH
Definition: testcreatecube.cpp:38
double Dtk_Double64
Definition: define.h:701
@ Vertex_H
Definition: testcreatecube.cpp:26
void setXdir(const Dtk_dir &X)
Set a new X vector.
@ Coedge2_FB
Definition: testcreatecube.cpp:50
This is a high level mesh class.
Definition: util_mesh_dtk.hpp:485
@ DistanceDimension
Definition: util_draw_dtk.hpp:4750
T1 first
Definition: util_stl_dtk.hpp:921
Dtk_Double64 & CharWidth()
Retrieves the char width - get/set -.
@ FaceABCD
Definition: testcreatecube.cpp:69
Definition: dtk_val.hpp:67
int add_subinfo(Dtk_InfoPtr &ininf)
static Dtk_FacePtr Create(const Dtk_BodyPtr &inParentBody)
Create a face in a body.
@ Vertex_G
Definition: testcreatecube.cpp:25
@ Coedge4_FE
Definition: testcreatecube.cpp:54
#define DTK_MESH_RGB
Definition: util_mesh_dtk.hpp:32
@ DTK_DASHED
Definition: util_ent_dtk.hpp:51
@ Loop0_ABCD
Definition: testcreatecube.cpp:63
@ FaceABFE
Definition: testcreatecube.cpp:70
static Dtk_ReferenceBlockPtr Create(const Dtk_Oriented2dBBox &inInnerBBox, const Dtk_Oriented2dBBox &inOuterBBox)
Calls full featured constructor to allocate a new object.
@ FaceGDCH
Definition: testcreatecube.cpp:72
@ Coedge3_DC
Definition: testcreatecube.cpp:44
@ Vertex_B
Definition: testcreatecube.cpp:20
@ FaceEFGH
Definition: testcreatecube.cpp:73
static Dtk_ReferenceFramePtr Create()
Calls default constructor to allocate a new object.
@ Edge_EA
Definition: testcreatecube.cpp:31
@ Edge_AB
Definition: testcreatecube.cpp:27
Dtk_anchor_type
Definition: util_draw_dtk.hpp:93
@ Edge_GF
Definition: testcreatecube.cpp:35
DTK_Text_type
Definition: str_def.h:11
int32_t Dtk_Int32
Definition: define.h:689
void resize(Dtk_Size_t n, const T &t)
Resizes the array.
Definition: util_stl_dtk.hpp:605
@ DTK_DOTTED
Definition: util_ent_dtk.hpp:57
@ TypeDatum
Definition: util_draw_dtk.hpp:6373
@ Coedge2_GD
Definition: testcreatecube.cpp:52
@ Loop1_ABFE
Definition: testcreatecube.cpp:64
static Dtk_DimensionPtr Create()
Calls default constructor to allocate a new object.
DimensionTypeEnum
Definition: util_draw_dtk.hpp:4730
static Dtk_LumpPtr Create(const Dtk_BodyPtr &inParentBody)
Create a lump in a body.
@ Vertex_D
Definition: testcreatecube.cpp:22
int add_point(Dtk_UInt32 inpnt)
T2 second
Definition: util_stl_dtk.hpp:922
static Dtk_SmartPtr< T > DtkDynamicCast(const Dtk_SmartPtr< T2 > &p)
Definition: util_ptr_dtk.hpp:101
void set_mesh_color(const Dtk_RGB &inColor)
set color in Dtk_mesh
@ Coedge1_FB
Definition: testcreatecube.cpp:49
@ Vertex_C
Definition: testcreatecube.cpp:21
Dtk_bool IsNULL() const
Definition: util_ptr_dtk.hpp:118
static Dtk_FdtPtr Create()
Calls default constructor to allocate a new object.
static Dtk_NurbsCurvePtr Create(const Dtk_NurbsCurve &in)
Calls copy constructor to allocate a new object.
void setScale(Dtk_Double64 scale)
Set a new scale.
Definition: util_ptr_dtk.hpp:37
static Dtk_EdgePtr Create(const Dtk_BodyPtr &inParentBody)
Create an edge in a body.
@ FaceFBDG
Definition: testcreatecube.cpp:71
@ Lump
Definition: testcreatecube.cpp:16
static Dtk_PointPtr Create(const Dtk_Point &in)
Calls copy constructor to allocate a new object.
@ Coedge1_EA
Definition: testcreatecube.cpp:47
void setYdir(const Dtk_dir &Y)
Set a new Y vector.
@ dtk_text_type_modifier
Definition: str_def.h:21
This is a mathematical point class.
Definition: dtk_pnt.hpp:22
@ Coedge4_EH
Definition: testcreatecube.cpp:61
This is the composite text class. It's basically a Dtk_Text Container. This class represents a group ...
Definition: util_draw_dtk.hpp:1536
@ Coedge2_BD
Definition: testcreatecube.cpp:46
static Dtk_LeaderPtr Create()
Calls default constructor to allocate a new object.
static Dtk_CameraPtr Create()
Calls default constructor to allocate a new object.
Dtk_ModelDisplayPtr CreateModelDisplayActivated()
Definition: testcreatefdt.cpp:324
@ TerminatorTypeClosedArrow
Definition: util_draw_dtk.hpp:1972
static Dtk_LinePtr Create(const Dtk_Line &in)
Calls copy constructor to allocate a new object.
Dtk_Double64 & CharHeight()
Retrieves the char height - get/set -.
This is a high level array class.
Definition: util_stl_dtk.hpp:85
static Dtk_VertexPtr Create(const Dtk_BodyPtr &inParentBody)
Create a vertex in a body.
static Dtk_CoedgePtr Create(const Dtk_BodyPtr &inParentBody)
Create a coedge in a body.
Dtk_BodyPtr CreateCube()
Definition: testcreatecube.cpp:1320
Dtk_Size_t size() const
Returns the size of the array.
Definition: util_stl_dtk.hpp:504
@ FaceEHCA
Definition: testcreatecube.cpp:74
@ Vertex_F
Definition: testcreatecube.cpp:24
@ Coedge5_HC
Definition: testcreatecube.cpp:58
@ Coedge1_AB
Definition: testcreatecube.cpp:40
@ Coedge0_AB
Definition: testcreatecube.cpp:39
LeaderTerminatorTypeEnum
Internal leader terminator type.
Definition: util_draw_dtk.hpp:1966
T & at(Dtk_Size_t k)
Definition: util_stl_dtk.hpp:398
void push_back(const T &x)
Inserts an element at the end of the array.
Definition: util_stl_dtk.hpp:417
static Dtk_ShellPtr Create(const Dtk_BodyPtr &inParentBody)
Create a shell in a body.
@ DTK_FRAME_TYPE_RECTANGLE
Definition: util_draw_dtk.hpp:130
@ Coedge0_CA
Definition: testcreatecube.cpp:41
static Dtk_GeometricalTolerancePtr Create()
Calls default constructor to allocate a new object.
void clear(int no_delete=0)
Resets the Dtk_tab content.
Definition: util_stl_dtk.hpp:353
void AddText(Dtk_Text inText)
Adds a Dtk_Text to the Dtk_CompositeText.
@ Edge_DC
Definition: testcreatecube.cpp:29
@ CubicalMapping
Definition: dtk_render.hpp:42
static Dtk_EllipsePtr Create(const Dtk_Ellipse &in)
Calls copy constructor to allocate a new object.
Definition: dtk_rgb.hpp:7
Dtk_ErrorStatus SetColor(const int &R, const int &G, const int &B)
static Dtk_SmartPtr< Dtk_Info > create()
Calls default constructor to allocate a new object.
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
@ Coedge1_FE
Definition: testcreatecube.cpp:51
static Dtk_PolylinePtr Create(const Dtk_Polyline &in)
Calls copy constructor to allocate a new object.
int add_mesh_face(Dtk_mesh_face *inMesh_face)
Add a face (Dtk_mesh_face) to the mesh.
This is a mathematical direction class.
Definition: dtk_dir.hpp:15
void Extend(const Dtk_Double64 &inXExtend, const Dtk_Double64 &inYExtend)
Extend the bounding box.
int add_polyline(const Dtk_tab< Dtk_UInt32 > *inIndices)
Add one polyline.
int add_points(const Dtk_tab< Dtk_UInt32 > *pnts)
@ Vertex_E
Definition: testcreatecube.cpp:23
static Dtk_VolumePtr Create(const Dtk_BodyPtr &inParentBody)
Create a volume in a body.
@ TypePosition
Definition: util_draw_dtk.hpp:6087
#define DTK_PI
Definition: str_def.h:8
@ Loop3_GDCH
Definition: testcreatecube.cpp:66
@ Loop4_EFGH
Definition: testcreatecube.cpp:67
@ Loop2_FBDG
Definition: testcreatecube.cpp:65
@ Edge_HG
Definition: testcreatecube.cpp:37
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.