 |
DATAKIT SDK
V2026.3
|
|
Set of sample functions to write specific data into a .stp file.
More...
|
| Dtk_AxisSystemPtr | CreateAxisSystem () |
| |
| void | CreateTransforms (Dtk_transfo &outFirst, Dtk_transfo &outSecond, Dtk_transfo &outThird, Dtk_transfo &outFourth) |
| |
| DtkErrorStatus | Write_MinimumViableFile (const Dtk_string &inPartName, int &outPartID) |
| |
| DtkErrorStatus | Write_UserDefinedHeader (const Dtk_string &inPartName, int &outPartID) |
| |
| DtkErrorStatus | WriteAssembly (const Dtk_string &inRootAssemblyName) |
| |
| DtkErrorStatus | WriteAssembly_BasicExternalReference_DimensionFDT (const Dtk_string &inRootAssemblyName) |
| |
| DtkErrorStatus | WriteAssembly_BasicExternalReferences (const Dtk_string &inRootAssemblyName) |
| |
| DtkErrorStatus | WriteAssembly_DimensionFDT (const Dtk_string &inRootAssemblyName) |
| |
| DtkErrorStatus | WriteAssembly_InstanceAttributes (const Dtk_string &inRootAssemblyName) |
| |
| DtkErrorStatus | WriteAssembly_InstanceOverride (const Dtk_string &inRootAssemblyName) |
| |
| DtkErrorStatus | WriteAssembly_NestedExternalReferences (const Dtk_string &inRootAssemblyName) |
| |
| DtkErrorStatus | WriteAssembly_WithProperties (const Dtk_string &inRootAssemblyName) |
| |
| DtkErrorStatus | WritePart_BodyAndMeshFromTessellation (const Dtk_string &inPartName, int &outPartID) |
| |
| DtkErrorStatus | WritePart_BodyInNamedLayer (const Dtk_string &inPartName, int &outPartID) |
| |
| DtkErrorStatus | WritePart_BodyOnly (const Dtk_string &inPartName, int &outPartID) |
| |
| DtkErrorStatus | WritePart_BodyWithAxisSystem (const Dtk_string &inPartName, int &outPartID) |
| |
| DtkErrorStatus | WritePart_Datum (const Dtk_string &inPartName, int &outPartID) |
| |
| DtkErrorStatus | WritePart_GeometricalTolerance (const Dtk_string &inPartName, int &outPartID) |
| |
| DtkErrorStatus | WritePart_MeshOnly (const Dtk_string &inPartName, int &outPartID) |
| |
| DtkErrorStatus | WritePart_MeshWithFaceColors (const Dtk_string &inPartName, int &outPartID) |
| |
| DtkErrorStatus | WritePart_UsedByExternalAssembly (const Dtk_string &inPartName, int &outPartID) |
| |
| DtkErrorStatus | WritePart_WireframeOnly (const Dtk_string &inPartName, int &outPartID) |
| |
| DtkErrorStatus | WritePart_WithProperties (const Dtk_string &inPartName, int &outPartID) |
| |
Set of sample functions to write specific data into a .stp file.
◆ CreateAxisSystem()
25 axis->SetMatrix( trsf );
26 axis->SetName(
"Axis_System" );
◆ CreateTransforms()
◆ Write_MinimumViableFile()
◆ Write_UserDefinedHeader()
◆ WriteAssembly()
392 int assignedID_leafPart = 0;
395 int assignedID_subProduct = 0;
407 int assignedID_rootProduct = 0;
◆ WriteAssembly_BasicExternalReference_DimensionFDT()
| DtkErrorStatus stepw::sample::WriteAssembly_BasicExternalReference_DimensionFDT |
( |
const Dtk_string & |
inRootAssemblyName | ) |
|
744 int assignedID_leafPart;
745 Dtk_string uniqueNameForLeafProduct = L
"ExternalPartWithBody_ReferencedByFDT";
749 int assignedID_instance1 = 0, assignedID_instance2 = 0, assignedID_instance3 = 0, assignedID_instance4 = 0;
750 int userID_instance1 = 101, userID_instance2 = 102, userID_instance3 = 103, userID_instance4 = 104;
751 int assignedID_subProduct = 0;
763 int assignedID_rootProduct = 0;
773 int userDefinedID_dimensionNode = 42;
780 int targetedFaceID_1 = 73;
790 int targetedFaceID_2 = 105;
◆ WriteAssembly_BasicExternalReferences()
663 int assignedID_leafPart = 0;
664 Dtk_string uniqueNameForProduct = L
"ExternalPartWithBody";
668 int assignedID_subProduct = 0;
679 int assignedID_rootProduct = 0;
◆ WriteAssembly_DimensionFDT()
481 int assignedID_leafPart = 0;
484 int assignedID_instance1 = 0, assignedID_instance2 = 0, assignedID_instance3 = 0;
485 int assignedID_subProduct = 0;
497 int assignedID_rootProduct = 0;
508 dimension->TransformationMatrix().setXdir(
Dtk_dir( 0., 1., 0. ) );
509 dimension->TransformationMatrix().setYdir(
Dtk_dir( -1., 0., 0. ) );
510 dimension->TransformationMatrix().setZdir(
Dtk_dir( 0., 0., 1. ) );
511 dimension->TransformationMatrix().setOrigin(
Dtk_pnt( 0., 0., -50. ) );
513 int userDefinedID_dimensionNode = 1002;
517 int targetedFaceID_1 = 10;
527 int targetedFaceID_2 = 10;
549 int viewModeThatReferencesAllFDTs = 1;
◆ WriteAssembly_InstanceAttributes()
621 int assignedID_leafPart = 0;
624 int assignedID_subProduct = 0;
635 int assignedID_rootProduct = 0;
◆ WriteAssembly_InstanceOverride()
431 int assignedID_leafPart = 0;
434 int assignedID_subProduct = 0;
435 int assignedID_instance1 = 0, assignedID_instance2 = 0;
436 int assignedID_unused1 = 0, assignedID_unused2 = 0;
449 int assignedID_rootProduct = 0;
456 overrideInfo->SetColor(
Dtk_RGB( 0, 0, 255 ) );
◆ WriteAssembly_NestedExternalReferences()
702 int assignedID_leafPart = 0;
703 Dtk_string uniqueNameForLeafProduct = L
"NestedExternalPartWithBody";
707 int assignedID_subProduct = 0;
709 Dtk_string uniqueNameForSubProduct = L
"NestedExternalSubProduct";
721 int assignedID_rootProduct = 0;
◆ WriteAssembly_WithProperties()
567 int assignedID_leafPart = 0;
570 int assignedID_subProduct = 0;
578 part_info->
AddAttribute(
"assembly validation property : : centre point", valprop_notional_CG );
582 Dtk_Val valprop_nbchildren( 3 );
583 prod_info->
AddAttribute(
"assembly validation property : : number of children", valprop_nbchildren );
593 int assignedID_rootProduct = 0;
597 Dtk_Val instance_kind(
"first" );
598 instance_info->
AddAttribute(
"user defined attribute : : instance kind", instance_kind );
600 instance_info->
AddAttribute(
"attribute validation property : : text user attributes", instance_valprop );
◆ WritePart_BodyAndMeshFromTessellation()
175 mesh = listMesh[ 0 ];
◆ WritePart_BodyInNamedLayer()
357 body1->get_info()->SetLayer( 42 );
358 body1->GetEntity( 10 )->info()->SetLayer( 0 );
359 body1->GetEntity( 20 )->info()->SetLayer( 0 );
360 body1->GetEntity( 30 )->info()->SetLayer( 0 );
363 body2->get_info()->SetLayer( 1900 );
365 body3->get_info()->SetLayer( 1900 );
◆ WritePart_BodyOnly()
◆ WritePart_BodyWithAxisSystem()
◆ WritePart_Datum()
239 int nodeid_Fdt1 = 42;
251 int userDefinedID_viewNode = 4242;
◆ WritePart_GeometricalTolerance()
287 int datum_node_id = 42;
301 geometricalTolerance->Transform( fdt_transf );
303 int geometrical_tolerance_node_id = 43;
315 int viewModeThatReferencesAllFDTs = 1;
◆ WritePart_MeshOnly()
◆ WritePart_MeshWithFaceColors()
◆ WritePart_UsedByExternalAssembly()
333 int userDefinedID_product = 42;
◆ WritePart_WireframeOnly()
◆ WritePart_WithProperties()
193 body->GetEntity( 10 )->info()->AddAttribute(
"face attribute : : surface finish",
Dtk_Val(
"Anodize per specification MIL-A-8625, Type I" ) );
197 body->GetEntity( 10 )->info()->AddCustomerDefinedAttribute(
"uncategorized float attribute",
Dtk_Val( 105.2 ) );
207 part_info->
AddAttribute(
"geometric validation property : : surface area measure",
Dtk_Val(
"1234 mm2" ) );
208 part_info->
AddAttribute(
"geometric validation property : : volume measure",
Dtk_Val(
"5678 mm3" ) );
215 prod_info->
AddAttribute(
"material property : material name : Steel",
Dtk_Val(
"Steel YC38" ) );
216 prod_info->
AddAttribute(
"material property : density : density measure",
Dtk_Val(
"7.89 g/cm3" ) );
Dtk_BodyPtr CreateCube_2()
Definition: testcreatecylfdt.cpp:1064
This is the Transformation dedicated class.
Definition: dtk_transfo.hpp:19
Dtk_BodyPtr CreateCurves_2()
Definition: testcreatecylfdt.cpp:1108
Dtk_ErrorStatus AddAttribute(Dtk_string name, Dtk_Val val)
Dtk_MeshPtr CreateMeshCube()
Mesh Cube sample.
Definition: testcreatemesh.cpp:204
Dtk_ErrorStatus stepw_AddOverrideInstanceInfo(stepw_ERP &inElementReferencePath, Dtk_InfoPtr &inOverrideInfo)
Assigns information on an instance in multi-level assembly context.
Dtk_ErrorStatus AddCustomerDefinedAttribute(Dtk_string name, Dtk_Val val)
void setOrigin(const Dtk_pnt &O)
Set a new O center point.
DtkErrorStatus stepw_InitProduct(const Dtk_string &inProductName, int &outAssignedID, Dtk_ID inProductUserID=0)
Initializes the definition context of a product.
DtkErrorStatus stepw_AddInstanceToPath(stepw_ERP &inOutElementReferencePath, const int inInstanceID)
Appends an instance identifier to the element reference path. The instance identifier is provided by ...
DtkErrorStatus stepw_SetProductLayerInfosSet(const Dtk_LayerInfosSetPtr inLayerInfoSet)
Sets the LayerInfosSet to refer to when writing the current product. It uses its mapping between laye...
int tess_InitTesselation(Dtk_string inWorkingDirectory, double inTolerance)
Init the tesselation library.
DtkErrorStatus stepw_Write3DConstructionGeometry(const Dtk_BodyPtr &inBody)
Writes a body as a construction geometry of a 3D part, of any kind (solid, shell / faces,...
Definition: stepw.hpp:445
DtkErrorStatus stepw_Write3DPartMesh(const Dtk_MeshPtr &inMesh)
Writes a mesh of a 3D part (3D content of a product).
This is a high level string class.
Definition: dtk_string.hpp:53
size_t Dtk_Size_t
Definition: define.h:711
static Dtk_SmartPtr< Dtk_AxisSystem > create()
Calls default constructor to allocate a new object.
#define PRINT_ERROR(inStatus)
Definition: testwriters.h:10
char Dtk_bool
Definition: define.h:724
DtkErrorStatus stepw_Write3DPartBody(const Dtk_BodyPtr &inBody)
Writes a body of a 3D part (3D content of a product), of any kind (solid, shell / faces,...
DtkErrorStatus stepw_Write3DPartBodyWithMesh(const Dtk_BodyPtr &inBody, const Dtk_MeshPtr &inMesh, const int inMode=0)
Writes a body of a 3D part (3D content of a product), associated with a mesh.
void FillFacesColors(Dtk_MeshPtr &inoutCubeMesh)
Filling mesh faces with colors.
Definition: testcreatemesh.cpp:241
DtkErrorStatus stepw_EndProduct(const int inProductID)
Ends the writing of a product - calls WriteAssemblyInstances if not yet done.
Dtk_ErrorStatus SetBlankedStatus(const Dtk_Int32 &inBlankedStatus)
Definition: dtk_val.hpp:67
Dtk_ErrorStatus stepw_Add3DPartProperty(const Dtk_MetaDataPtr &inProperty)
Adds a roperty to a part (default), or to an entity, according to InitPropertySet mode.
DtkErrorStatus stepw_SetReferencePath(stepw_ER &inOutElementReference, stepw_ERP &inElementReferencePath)
Assigns the element reference path to the element reference.
DtkErrorStatus stepw_CreateReference(stepw_ER &inOutElementReference, const int inEntityID, const int inProductID=0, const char *inReferenceKind="")
Creates a reference to an entity located in the designated Product/Part context, or current context i...
DtkErrorStatus WritePart_BodyOnly(const Dtk_string &inPartName, int &outPartID)
Definition: testlibstepwrite.cpp:68
Dtk_ErrorStatus stepw_AddExternalReference(const Dtk_string &inProductName, const Dtk_string &inFileName, int &outID, Dtk_ID inInstCompId=0)
Declares a product to be written as an external reference (separated file).
DtkErrorStatus stepw_Init3DPart(const int inProductID)
Initializes the writing of a 3D part for the designated product.
DtkErrorStatus Write_MinimumViableFile(const Dtk_string &inPartName, int &outPartID)
Definition: testlibstepwrite.cpp:43
DtkErrorStatus stepw_AddInstanceWithInfo(const int inFatherProductID, const int inChildProductID, const Dtk_transfo &inPosition, const Dtk_string &inInstanceName, const Dtk_InfoPtr &inInstanceInfo)
Adds an instance of a product ( child ) in an assembly product ( father ), with provided attributes.
Dtk_FdtPtr CreateFdtDatum()
Creates simple Datum.
Definition: testcreatefdt.cpp:15
Dtk_ErrorStatus tess_BodyToMeshes(const Dtk_BodyPtr &inBodyToWrite, Dtk_tab< Dtk_MeshPtr > &outMeshes, Dtk_tab< Dtk_Int32 > &outIsSolid, Dtk_bool inTessWireframe=DTK_FALSE, Dtk_bool inApplyRenderInfos=DTK_FALSE)
Tesselate a body. Generates one mesh per shell in the body.
DtkErrorStatus stepw_AddInstance(const int inFatherProductID, const int inChildProductID, const Dtk_transfo &inPosition, const Dtk_string &inInstanceName)
Adds an instance of a product ( child ) in an assembly product ( father ).
char Dtk_Char8
Definition: define.h:696
DtkErrorStatus stepw_Add3DPartFDT(const Dtk_FdtPtr &inFDT)
Adds a FDT in the current part context.
static Dtk_SmartPtr< Dtk_Face > DtkDynamicCast(const Dtk_SmartPtr< T2 > &p)
Definition: util_ptr_dtk.hpp:101
Dtk_BodyPtr CreateConstructionPlane()
Definition: testcreatecylfdt.cpp:1155
DtkErrorStatus stepw_SetPartProperties(const Dtk_InfoPtr &inInfo, const int inItem)
Defines properties to be attached directly to the product : considers the list of Dtk_Val in the Dtk_...
DtkErrorStatus stepw_SetAnchorProduct(const int inProductID, const int inUserID)
Declares the product as having an ANCHOR section. If the designated product is already declared as su...
Definition: util_ptr_dtk.hpp:37
DtkErrorStatus stepw_End3DPart()
Ends the writing of a product 3D part.
DtkErrorStatus stepw_Write3DAxisSystem(const Dtk_AxisSystemPtr &inAxis)
Writes an axis system of a 3D part, in STEP, it is a construction geometry based on an axis placement...
void CreateTransforms(Dtk_transfo &outFirst, Dtk_transfo &outSecond, Dtk_transfo &outThird, Dtk_transfo &outFourth)
Definition: testlibstepwrite.cpp:30
Dtk_AxisSystemPtr CreateAxisSystem()
Definition: testlibstepwrite.cpp:20
DtkErrorStatus stepw_AddReference(stepw_ER &inElementReference)
Registers the previously created element reference in the writer.
This is a mathematical point class.
Definition: dtk_pnt.hpp:20
Dtk_ErrorStatus stepw_Add3DModelDisplay(const Dtk_ModelDisplayPtr &inModelDisplay, const int inMode)
Adds a view ( Dtk_ModelDisplay ) in the current part context.
DtkErrorStatus WritePart_UsedByExternalAssembly(const Dtk_string &inPartName, int &outPartID)
Definition: testlibstepwrite.cpp:327
Dtk_ModelDisplayPtr CreateModelDisplayActivated()
Definition: testcreatefdt.cpp:320
This is a high level array class.
Definition: util_stl_dtk.hpp:84
Definition: stepw.hpp:438
Dtk_Size_t size() const
Returns the size of the array.
Definition: util_stl_dtk.hpp:503
DtkErrorStatus stepw_CreateInstancePath(stepw_ERP &inOutElementReferencePath)
Initializes a path for the element reference, identifying the sequence of instances to pass through.
DtkErrorStatus stepw_SetHeaderData(const int inNumItem, const wchar_t *inValItem)
Sets STEP file header fields value.
DtkErrorStatus stepw_CreateReferenceToNode(stepw_ER &inOutElementReference, const int inNodeID, const int inProductID=0, const char *inReferenceKind="")
Creates a reference to a whole node (Dtk_Node), located in the designated Product/Part context.
Dtk_BodyPtr CreateCylinder()
Definition: testcreatecylfdt.cpp:1179
void stepw_EndNodeContext(const int unused=0)
Ends current node context.
Dtk_FdtPtr CreateDimension()
Definition: testcreatefdt.cpp:112
@ dtkNoError
Definition: error_dtk.hpp:151
Definition: dtk_rgb.hpp:7
Dtk_ErrorStatus SetColor(const int &R, const int &G, const int &B)
Dtk_LayerInfosSetPtr CreateSet()
Create Layer info set.
Definition: testcreatelayerinfoset.cpp:14
static Dtk_SmartPtr< Dtk_Info > create()
Calls default constructor to allocate a new object.
void stepw_InitNodeContext(const int inNodeID)
Initializes the context to write entities in a node.
Dtk_ErrorStatus stepw_AddAnchorItem(const int inEntityID, const int inProductID, const Dtk_string &inGUID)
Registers an entity in the ANCHOR section, with an assigned GUID (optional).
This is a mathematical direction class.
Definition: dtk_dir.hpp:14
b V2026 li b Input datum
Definition: EN_news.txt:10
Dtk_FdtPtr CreateGeometricalTolerance()
Definition: testcreatefdt.cpp:225