![Logo](tetiere_ht.jpg) |
DATAKIT API
V2025.1
|
|
◆ close_file_to_read()
void close_file_to_read |
( |
| ) |
|
◆ CreateAxisSystem()
85 axis->SetMatrix( trsf );
86 axis->SetName(
"Axis_System" );
◆ CreateView()
45 Dtk_pnt projpoint( 0., 0., 50. );
51 double viewdist = 50.;
◆ init_file_to_read()
int init_file_to_read |
( |
char * |
filename | ) |
|
◆ StepWriteSample()
int StepWriteSample |
( |
const Dtk_string & |
inResultDirectory | ) |
|
532 cout << endl <<
"----------------------------------------------" << endl;
533 cout <<
"Step Write start" << endl;
536 outputDirectory = inResultDirectory + L
"dtk/Step/";
538 outputDirectory.
mkdir();
539 outputFileName = outputDirectory + L
"RootProduct.step";
569 cout <<
"=> " << outputFileName.
c_str() << endl;
570 cout <<
"Step Write end" << endl;
◆ WriteAsm()
273 Dtk_transfo TransformationMatrix0, TransformationMatrix1, TransformationMatrix2;
274 Dtk_pnt orig1; orig1[ 0 ] = orig1[ 1 ] = 0.; orig1[ 2 ] = 200.;
275 Dtk_pnt orig2; orig2[ 0 ] = orig2[ 2 ] = 0.; orig2[ 1 ] = 300.;
276 TransformationMatrix1.
setOrigin( orig1 );
277 TransformationMatrix2.
setOrigin( orig2 );
280 int PartID =
WritePart( L
"essaiPart", 0 );
288 status =
stepw_AddInstance( ProdID2, PartID, TransformationMatrix0,
"PartInstance" );
294 part_info->
AddAttribute(
"assembly validation property : : centre point", valprop_notional_CG );
297 Dtk_Val valprop_nbchildren( 3 );
298 prod_info->
AddAttribute(
"assembly validation property : : number of children", valprop_nbchildren );
314 Dtk_Val instance_kind(
"first" );
315 instance_info->
AddAttribute(
"user defined attribute : : instance kind", instance_kind );
317 instance_info->
AddAttribute(
"attribute validation property : : text user attributes", instance_valprop );
322 status =
stepw_AddInstance( ProdID, ProdID2, TransformationMatrix1,
"PartInstance1" );
323 status =
stepw_AddInstance( ProdID, ProdID2, TransformationMatrix2,
"PartInstance2" );
◆ WriteAsmExt()
void WriteAsmExt |
( |
const int |
level, |
|
|
const int |
asm_only |
|
) |
| |
349 Dtk_transfo TransformationMatrix0, TransformationMatrix1, TransformationMatrix2;
350 Dtk_pnt orig1; orig1[ 0 ] = orig1[ 1 ] = 0.; orig1[ 2 ] = 200.;
351 Dtk_pnt orig2; orig2[ 0 ] = orig2[ 2 ] = 0.; orig2[ 1 ] = 300.;
352 TransformationMatrix1.
setOrigin( orig1 );
353 TransformationMatrix2.
setOrigin( orig2 );
362 if( !asm_only || level == 0 )
373 status =
stepw_AddInstance( ProdID2, PartID, TransformationMatrix0,
"PartInstance" );
379 part_info->
AddAttribute(
"assembly validation property : : centre point", valprop_notional_CG );
382 Dtk_Val valprop_nbchildren( 3 );
383 prod_info->
AddAttribute(
"assembly validation property : : number of children", valprop_nbchildren );
399 Dtk_Val instance_kind(
"first" );
400 instance_info->
AddAttribute(
"user defined attribute : : instance kind", instance_kind );
402 instance_info->
AddAttribute(
"attribute validation property : : text user attributes", instance_valprop );
407 status =
stepw_AddInstance( ProdID, ProdID2, TransformationMatrix1,
"PartInstance1" );
408 status =
stepw_AddInstance( ProdID, ProdID2, TransformationMatrix2,
"PartInstance2" );
◆ WriteAsmFdt()
void WriteAsmFdt |
( |
const int |
level | ) |
|
432 Dtk_transfo TransformationMatrix0, TransformationMatrix1, TransformationMatrix2;
433 Dtk_pnt orig1; orig1[ 0 ] = orig1[ 1 ] = 0.; orig1[ 2 ] = 200.;
434 Dtk_pnt orig2; orig2[ 0 ] = orig2[ 2 ] = 0.; orig2[ 1 ] = 300.;
435 TransformationMatrix1.
setOrigin( orig1 );
436 TransformationMatrix2.
setOrigin( orig2 );
456 int InstID1, InstID2, InstID3, InstID4;
457 int UserInstID1 = 1, UserInstID2 = 2, UserInstID3 = 3, UserInstID4 = 4;
458 status =
stepw_AddInstanceWithInfo( ProdID2, PartID, TransformationMatrix0,
"PartInstance", instance_info, InstID1, UserInstID1,
"RD1" );
472 status =
stepw_AddInstanceWithInfo( ProdID, PartID, TransformationMatrix0,
"PartInstance", instance_info, InstID2, UserInstID2,
"RD2" );
475 status =
stepw_AddInstanceWithInfo( ProdID, ProdID2, TransformationMatrix1,
"PartInstance1", instance_info, InstID3, UserInstID3,
"RD3" );
476 status =
stepw_AddInstanceWithInfo( ProdID, ProdID2, TransformationMatrix2,
"PartInstance2", instance_info, InstID4, UserInstID4,
"RD4" );
484 int nodeid_fdtasm = 1002;
◆ WritePart()
int WritePart |
( |
const Dtk_string & |
inReferenceName, |
|
|
const int |
ifdt |
|
) |
| |
137 Dtk_Val valprop_area(
"1234 mm2" );
138 part_info->
AddAttribute(
"geometric validation property : : surface area measure", valprop_area );
139 Dtk_Val valprop_volume(
"5678 mm3" );
140 part_info->
AddAttribute(
"geometric validation property : : volume measure", valprop_volume );
142 part_info->
AddAttribute(
"geometric validation property : : centre point", valprop_CG );
146 Dtk_Val mat_name(
"Steel YC38" );
147 prod_info->
AddAttribute(
"material property : material name : Steel", mat_name );
148 Dtk_Val mat_density(
"7.89 g/cm3" );
149 prod_info->
AddAttribute(
"material property : density : density measure", mat_density );
163 int nodeid_Fdt1 = 1001;
175 int nodeid_View1 = 2001;
◆ WritePartCyl()
int WritePartCyl |
( |
const Dtk_string & |
inReferenceName, |
|
|
const int |
itessel |
|
) |
| |
224 Dtk_Val valprop_area(
"1234 mm2" );
225 part_info->
AddAttribute(
"geometric validation property : : surface area measure", valprop_area );
226 Dtk_Val valprop_volume(
"5678 mm3" );
227 part_info->
AddAttribute(
"geometric validation property : : volume measure", valprop_volume );
229 part_info->
AddAttribute(
"geometric validation property : : centre point", valprop_CG );
static Dtk_ModelDisplayPtr Create(const Dtk_CameraPtr &inCamera, const Dtk_EntityPtr &inClippingEntity, const Dtk_bool inIsActivated)
Full featured constructor.
Dtk_BodyPtr CreateCube_2()
Definition: testcreatecylfdt.cpp:1092
DtkErrorStatus stepw_AddInstanceWithInfo(const int inIDfather, const int inIDchild, const Dtk_transfo &inPosition, const Dtk_string &inInstanceName, const Dtk_InfoPtr &inInstanceInfo)
Adds an instance of a sub-component (child) in a product (father : assembly node)
DtkErrorStatus stepw_CreateReference(stepw_ER &ER, const int inEntityID)
DtkErrorStatus stepw_AddInstance(const int inIDfather, const int inIDchild, const Dtk_transfo &inPosition, const Dtk_string &inInstanceName)
Adds an instance of a sub-component (child) in a product (father : assembly node)
This is the Transformation dedicated class.
Definition: dtk_transfo.hpp:19
Dtk_BodyPtr CreateCurves_2()
Definition: testcreatecylfdt.cpp:1138
Dtk_ErrorStatus AddAttribute(Dtk_string name, Dtk_Val val)
Dtk_ErrorStatus SetName(Dtk_string inName)
DtkErrorStatus stepw_Init3DPart(const int inID)
Initialise the writing of a 3D part : the own 3D part of a product (NOT its sub-components if any !...
DtkErrorStatus stepw_SetReferencePath(stepw_ER &ER, stepw_ERP &ERP)
void setOrigin(const Dtk_pnt &O)
Set a new O center point.
ProjectionTypeEnum
Definition: util_draw_dtk.hpp:7866
#define DTK_TRUE
Definition: define.h:727
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:394
DtkErrorStatus stepw_SetModeFdt(const int inMode, const int inPolyline=0)
Activates/Deactivates writing of FDT (ignored if product Step3dWriteFdt is not present)
This is a high level string class.
Definition: dtk_string.hpp:58
static Dtk_SmartPtr< Dtk_AxisSystem > create()
DtkErrorStatus stepw_InitProduct(const Dtk_string &inProductName, int &outID, Dtk_ID inCompID=0)
Initialise the writing of a product (assembly node and/or part with 3D bodies)
DtkErrorStatus stepw_AddReference(stepw_ER &ER)
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_SetAnchorProduct(const int stepw_ID, const int user_ID)
DtkErrorStatus stepw_EndProduct(const int inID)
Ends the writing of a product - calls WriteAssemblyInstances if not yet done.
DtkErrorStatus stepw_SetModeProp(const int inMode)
Activates/Deactivates writing of Properties : User Attributes, Product Data.
const Dtk_dir & getZdir() const
Return the Z vector.
Definition: dtk_val.hpp:67
Dtk_ErrorStatus stepw_Add3DPartProperty(const Dtk_MetaDataPtr &inProperty)
Commands to write a Property to a Part (at the level of the whole Part) by default,...
const Dtk_string & inReferenceName
Definition: catiav5w.hpp:456
DtkErrorStatus stepw_CreateInstancePath(stepw_ERP &ERP)
Dtk_FdtPtr CreateFdtDimAssy()
PMI in Assembly : a dimension between faces of different instances.
Definition: testcreatefdt.cpp:118
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 external reference.
Dtk_FdtPtr CreateFdtDatum()
Create Simple Datum.
Definition: testcreatefdt.cpp:19
DtkErrorStatus stepw_CreateReferenceToNode(stepw_ER &ER, const int inNodeID, const int inProductID, const char *inRefKind="")
DtkErrorStatus stepw_Add3DPartFDT(const Dtk_FdtPtr &inFDT)
Commands to write a FDT of a 3D Part.
static Dtk_SmartPtr< Dtk_Entity > DtkDynamicCast(const Dtk_SmartPtr< T2 > &p)
Definition: util_ptr_dtk.hpp:101
Dtk_bool IsNULL() const
Definition: util_ptr_dtk.hpp:118
Dtk_BodyPtr CreateConstructionPlane()
Definition: testcreatecylfdt.cpp:1185
@ ProjectionTypeParallel
Definition: util_draw_dtk.hpp:7868
DtkErrorStatus stepw_SetPartProperties(const Dtk_InfoPtr &inInfo, const int inItem)
Defines properties to be attached directly to the component : considers the list of Dtk_Val in the Dt...
Definition: util_ptr_dtk.hpp:37
DtkErrorStatus stepw_EndFile()
Ends the writing of the STEP file.
Dtk_string dtkTypeError(Dtk_Int32 errNumero)
DtkErrorStatus stepw_End3DPart()
Ends the writing of a part : the own 3D part of a product + product definition.
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...
const char * c_str() const
Retrieve the ASCII conversion string.
Dtk_AxisSystemPtr CreateAxisSystem()
Definition: testlibstepwrite.cpp:80
int WritePart(const Dtk_string &inReferenceName, const int ifdt)
Definition: testlibstepwrite.cpp:95
int mkdir() const
File Utility : Create a Directory.
This is a mathematical point class.
Definition: dtk_pnt.hpp:22
Dtk_ErrorStatus stepw_Add3DModelDisplay(const Dtk_ModelDisplayPtr &inModelDisplay, const int inMode)
Commands to write a Model Display (type Dtk_ModelDisplay) in a 3d Part.
Dtk_ErrorStatus stepw_AddAnchorItem(const int inEntityID, const int inProductID, const Dtk_string &inGUID)
void FixPathSeparator()
File Utility : Fixes path separator consistency. It lets you replace the '\' or '/' by the OS needed ...
DtkErrorStatus stepw_InitFile(const Dtk_string &inFileOut, const char *Origin=" user ", const int StepSchema=0)
Initialise a file to be written.
static Dtk_CameraPtr Create()
Base constructor.
Definition: stepw.hpp:387
DtkErrorStatus stepw_AddInstanceToPath(stepw_ERP &ERP, const int inInstanceID)
const Dtk_dir & getYdir() const
Return the Y vector.
Dtk_ModelDisplayPtr CreateView()
Definition: testlibstepwrite.cpp:39
Dtk_BodyPtr CreateCylinder()
Definition: testcreatecylfdt.cpp:1211
void WriteAsmExt(const int level, const int asm_only)
Definition: testlibstepwrite.cpp:346
static Dtk_SmartPtr< Dtk_Info > create()
void stepw_InitNodeContext(const int inNodeID)
Initialises the context to write items in a node of the model (internal model tree,...
This is a mathematical direction class.
Definition: dtk_dir.hpp:15
void stepw_EndNodeContext(const int inNodeID=0)