DATAKIT SDK  V2026.4
Full samples source code
// TestLibUgWrite.cpp
// Sample demonstrating how to write NX/UG files using the Datakit NX writer (ugw).
// Shows how to write bodies, meshes, wireframe, references, layers, groups, ref sets, metadata, colors, assemblies and FDT.
#include "testwriters.h"
#include "datakit.h"
#include "ugw/ugw.hpp"
// ----------------------------------------------------------------------------------------------
//start_of_ugwsample11
//! \brief Sample 1.1: writes a single BRep cube body into an NX file.
Dtk_ErrorStatus UgwSimpleBody(const Dtk_string& inOutputFileName, int inVersion)
{
// Cube Sample
//CubeBody->info()->AddAttribute("MATERIALNAME", Dtk_string("Ash Gloss"));
// First we initialize writer with name of output file (see macro CHECK_OK above)
CHECK_OK(Ugw::InitFile(inOutputFileName, inVersion));
// Then we write the body constructed
// Write final file and release the writer.
std::cout << "=> " << inOutputFileName.c_str() << std::endl;
return dtkNoError;
}
//end_of_ugwsample11
// ----------------------------------------------------------------------------------------------
//start_of_ugwsample12
//! \brief Sample 1.2: writes two named cubes (translated apart) into an NX file.
Dtk_ErrorStatus UgwTwoBodies(const Dtk_string& inOutputFileName, int inVersion)
{
// Cube Sample
// We construct 2 cubes, translating the second
cube1->info()->SetName("FirstCube");
cube2->info()->SetName("SecondCube");
Dtk_transfo translate(Dtk_dir(1, 0, 0), Dtk_dir(0, 1, 0), Dtk_dir(0, 0, 1), Dtk_pnt(200, 0, 0));
cube2->Transform(translate);
// First we initialize writing with name of output file (see macro CHECK_OK above)
CHECK_OK(Ugw::InitFile(inOutputFileName, inVersion));
// Then we write the 2 bodies constructed
// Write final file and release the writer.
std::cout << "=> " << inOutputFileName.c_str() << std::endl;
return dtkNoError;
}
//end_of_ugwsample12
// ----------------------------------------------------------------------------------------------
//start_of_ugwsample13
//! \brief Sample 1.3: writes a cylinder mesh into an NX file.
Dtk_ErrorStatus UgwMesh(const Dtk_string& inOutputFileName, int inVersion)
{
Dtk_MeshPtr CubeMesh = sampleWriter::CreateMeshCylinder(8); // get a meshcylinder (common sample)
CubeMesh->info()->SetName("MyMesh");
CHECK_OK(Ugw::InitFile(inOutputFileName, inVersion));
std::cout << "=> " << inOutputFileName.c_str() << std::endl;
return dtkNoError;
}
//end_of_ugwsample13
// ----------------------------------------------------------------------------------------------
//start_of_ugwsample14
//! \brief Sample 1.4: writes a wireframe body (curves) into an NX file.
Dtk_ErrorStatus UgwWire(const Dtk_string& inOutputFileName, int inVersion)
{
CHECK_OK(Ugw::InitFile(inOutputFileName, inVersion));
std::cout << "=> " << inOutputFileName.c_str() << std::endl;
return dtkNoError;
}
//end_of_ugwsample14
// ----------------------------------------------------------------------------------------------
//start_of_ugwsample15
{
Dtk_transfo axisTransform;
axisTransform.addTranslate(Dtk_dir(-100, 50, 200));
axis->SetName("MyAxisSystem");
axis->info()->AddAttribute("NXNAME", Dtk_Val("ANOTHERAXISSYSTEM"));
axis->info()->SetColor(255, 255, 0);
axis->SetMatrix(axisTransform);
return axis;
}
{
body->info() = Dtk_Info::Create();
body->info()->SetName("MyReferencePlane");
body->info()->AddAttribute("NXNAME", Dtk_Val("MYPLANE"));
body->info()->SetColor(0, 255, 255);
body->AddOpenShell(shell);
Dtk_PlaneSurfacePtr plane = Dtk_PlaneSurface::Create(Dtk_pnt(150, 150, 0), Dtk_dir(0, 0, 1), Dtk_dir(1, 0, 0));
shell->AddFace(face, DTK_TRUE);
return body;
}
{
body->info() = Dtk_Info::Create();
body->info()->SetName("MyFixedRefPlane");
body->info()->AddAttribute("NXNAME", Dtk_Val("ANOTHERFIXEDPLANENAME"));
body->info()->SetColor(0, 0, 255);
body->AddOpenShell(shell);
Dtk_PlaneSurfacePtr plane = Dtk_PlaneSurface::Create(Dtk_pnt(250, 250, 0), Dtk_dir(0, 0, 1), Dtk_dir(1, 0, 0));
double trim[] = { -10,10,-10,10 };
plane->SetTrimUVBox(trim);
shell->AddFace(face, DTK_TRUE);
return body;
}
{
body->info() = Dtk_Info::Create();
body->info()->SetName("MyRefAxis");
body->info()->AddAttribute("NXNAME", Dtk_Val("ANOTHERAXISNAME"));
body->info()->SetColor(0, 255, 0);
body->AddOpenShell(shell);
Dtk_LinePtr line = Dtk_Line::Create(Dtk_pnt(160, 100, 10), Dtk_pnt(260, 200, 30));
shell->AddWire(tab);
return body;
}
{
body->info() = Dtk_Info::Create();
body->info()->SetName("MyRefPoint");
body->info()->SetColor(255, 100, 0);
body->AddOpenShell(shell);
Dtk_PointPtr point = Dtk_Point::Create(Dtk_pnt(0, 310, 10));
tab.push_back(point);
shell->AddWire(tab);
return body;
}
Dtk_ErrorStatus UgwReferences(const Dtk_string& inOutputFileName, int inVersion)
{
CHECK_OK(Ugw::InitFile(inOutputFileName, inVersion));
cube->info()->SetName("MyCube");
cube->info()->AddAttribute("NXNAME", Dtk_Val("SOLIDBODYNAME"));
std::cout << "=> " << inOutputFileName.c_str() << std::endl;
return dtkNoError;
}
//end_of_ugwsample15
// ----------------------------------------------------------------------------------------------
//start_of_ugwsample16
//! \brief Sample 1.6: embeds an existing Parasolid binary stream into an NX file as an external reference.
Dtk_ErrorStatus UgwExternParasolid(const Dtk_string& inOutputFileName, const Dtk_string& inParasolidFilePath, int inVersion)
{
FILE* parasolidFile = inParasolidFilePath.OpenFile(DTK_RB);
if (!parasolidFile)
{
std::cout << "error : " << inParasolidFilePath.c_str() << " does not exist" << std::endl;
}
fseek(parasolidFile, 0, SEEK_END);
flux.resize(ftell(parasolidFile));
fseek(parasolidFile, 0, SEEK_SET);
if (flux.size() > 0)
fread(&flux[0], 1, flux.size(), parasolidFile);
fclose(parasolidFile);
inf->SetName("MyFeatureName");
inf->AddAttribute("NXNAME", Dtk_string("SolidName"));
//inf->SetBlankedStatus(1); // set as invisible
//inf->SetColor(Dtk_RGB(255, 0, 0)); // set a body color (appear on non colored faces)
CHECK_OK(Ugw::InitFile(inOutputFileName, inVersion));
CHECK_OK(Ugw::WriteExternParasolidBody(&flux[0], flux.size(), inf));
std::cout << "=> " << inOutputFileName.c_str() << std::endl;
return dtkNoError;
}
//end_of_ugwsample16
// ----------------------------------------------------------------------------------------------
//start_of_ugwsample17
//! \brief Sample 1.7: embeds an existing JT mesh stream into an NX file as external reference.
Dtk_ErrorStatus UgwExternJTMesh(const Dtk_string& inOutputFileName, const Dtk_string& inJtFilePath, int inVersion)
{
FILE* jtFile = inJtFilePath.OpenFile(DTK_RB);
if (!jtFile)
{
std::cout << "error : " << inJtFilePath.c_str() << " does not exist" << std::endl;
}
fseek(jtFile, 0, SEEK_END);
flux.resize(ftell(jtFile));
fseek(jtFile, 0, SEEK_SET);
if (flux.size() > 0)
fread(&flux[0], 1, flux.size(), jtFile);
fclose(jtFile);
inf->SetName("MyFeatureName");
inf->AddAttribute("NXNAME", Dtk_string("SolidName"));
//inf->SetBlankedStatus(1); // set as invisible
//inf->SetColor(Dtk_RGB(255, 0, 0)); // set a body color (appear on non colored faces)
CHECK_OK(Ugw::InitFile(inOutputFileName, inVersion));
CHECK_OK(Ugw::WriteExternJtMesh(&flux[0], flux.size(), inf));
std::cout << "=> " << inOutputFileName.c_str() << std::endl;
return dtkNoError;
}
//end_of_ugwsample17
// ----------------------------------------------------------------------------------------------
//start_of_ugwsample21
//! \brief Sample 2.1: writes a cube and a cylinder mesh each assigned to specific layers, with layer info set.
Dtk_ErrorStatus UgwLayers(const Dtk_string& inOutputFileName, int inVersion)
{
Dtk_BodyPtr CubeBody = sampleWriter::CreateCube(); // get a brepcube (common sample)
Dtk_MeshPtr CylMesh = sampleWriter::CreateMeshCylinder(8); // get a meshcyl (common sample)
Dtk_transfo translatescale(Dtk_dir(20, 0, 0), Dtk_dir(0, 20, 0), Dtk_dir(0, 0, 20), Dtk_pnt(150, 0, 0));
CylMesh->Transform(translatescale);
CHECK_OK(Ugw::InitFile(inOutputFileName, inVersion));
CubeBody->info()->SetLayer(5);
CylMesh->info()->SetLayer(6);
CHECK_OK( Ugw::SetLayerData( layerinfoset ) );
// Then we write the 2 bodies constructed
// Write final file and release the writer.
std::cout << "=> " << inOutputFileName.c_str() << std::endl;
return dtkNoError;
}
//end_of_ugwsample21
// ----------------------------------------------------------------------------------------------
//start_of_ugwsample22
//! \brief Sample 2.2: writes bodies and a mesh grouped under named entity groups.
Dtk_ErrorStatus UgwGroups(const Dtk_string& inOutputFileName, int inVersion)
{
cube1->info()->SetName("FirstCube");
cube2->info()->SetName("SecondCube");
Dtk_transfo translate(Dtk_dir(1, 0, 0), Dtk_dir(0, 1, 0), Dtk_dir(0, 0, 1), Dtk_pnt(200, 0, 0));
cube2->Transform(translate);
Dtk_MeshPtr CylMesh = sampleWriter::CreateMeshCylinder(8); // get a meshcyl (common sample)
CylMesh->info()->SetName("OneMesh");
Dtk_transfo translatescale(Dtk_dir(10, 0, 0), Dtk_dir(0, 10, 0), Dtk_dir(0, 0, 10), Dtk_pnt(-100, 0, 0));
CylMesh->Transform(translatescale);
WireBody->Transform(translatescale);
CHECK_OK(Ugw::InitFile(inOutputFileName, inVersion));
// put cube1 in group GroupRoot/Sub1
cube1->info()->AddAttribute("NXGROUPS", Dtk_Val("GroupRoot\\Sub1\\"));
// put cube1 in group GroupRoot/Sub1 and also GroupRoot/Sub2
cube2->info()->AddAttribute("NXGROUPS", Dtk_Val("GroupRoot\\Sub1\\\\GroupRoot\\Sub2\\"));
// put Mesh in group GroupRoot/Sub2
CylMesh->info()->AddAttribute("NXGROUPS", Dtk_Val("GroupRoot\\Sub2\\"));
// put Wire in group GroupRoot/Sub2
WireBody->info()->AddAttribute("NXGROUPS", Dtk_Val("GroupRoot\\Sub2\\"));
// set property to group Sub2
infsub2->SetBlankedStatus(1);
infsub2->SetLayer(23);
CHECK_OK(Ugw::SetGroupDatas("Sub2", infsub2)); // Sub2 become invisible, and on layer 23
// make an empty group
infsub3->AddAttribute("NXGROUPS", Dtk_Val("GroupRoot\\Sub3\\"));
infsub3->SetLayer(19);
CHECK_OK(Ugw::SetGroupDatas("Sub3", infsub3)); // Sub3 become an empty group on layer 19
// Then we write the 2 bodies constructed
// Write final file and release the writer.
std::cout << "=> " << inOutputFileName.c_str() << std::endl;
return dtkNoError;
}
//end_of_ugwsample22
// ----------------------------------------------------------------------------------------------
//start_of_ugwsample23
//! \brief Sample 2.3: writes bodies assigned to NX reference sets via the NXREFERENCESET attribute.
Dtk_ErrorStatus UgwRefSets(const Dtk_string& inOutputFileName, int inVersion)
{
cube1->info()->SetName("FirstCube");
cube2->info()->SetName("SecondCube");
Dtk_transfo translate(Dtk_dir(1, 0, 0), Dtk_dir(0, 1, 0), Dtk_dir(0, 0, 1), Dtk_pnt(200, 0, 0));
cube2->Transform(translate);
// reference set
// Cube1 into reference set "MyRef1","MyRef2","MyRef3"
cube1->info()->AddAttribute("NXREFERENCESET", Dtk_Val("MyRef1\\MyRef2\\MyRef3\\"));
// Cube2 into reference set "MyRef1","MyRef3"
cube2->info()->AddAttribute("NXREFERENCESET", Dtk_Val("MyRef1\\MyRef3\\"));
CHECK_OK(Ugw::InitFile(inOutputFileName, inVersion));
// Then we write the 2 bodies constructed
// Write final file and release the writer.
std::cout << "=> " << inOutputFileName.c_str() << std::endl;
return dtkNoError;
}
//end_of_ugwsample23
// ----------------------------------------------------------------------------------------------
//start_of_ugwsample24
Dtk_MetaDataPtr MakeMetaData(const Dtk_string& inPropertyName, const Dtk_string& inValue, const Dtk_string& inCategory = "")
{
meta->SetCategory(inCategory);
return meta;
}
//! \brief Sample 2.4: writes a cube with metadata (properties in categories) and custom unit/tolerance defaults.
Dtk_ErrorStatus UgwMeta(const Dtk_string& inOutputFileName, int inVersion)
{
def.unit = Ugw::DefaultParameters::Unit::inch;
def.background_color_top = Dtk_RGB( 255, 0, 0 );
def.background_color_bottom = Dtk_RGB( 0, 255, 0 );
CHECK_OK(Ugw::InitFile(inOutputFileName, inVersion, def));
// custom metadata
CHECK_OK(Ugw::AddMetaData(MakeMetaData("MyPropTitle", "MyPropValue", "CategoryNX1980")));
CHECK_OK(Ugw::AddMetaData(MakeMetaData("MyPropTitle2", "MyPropValue2", "CategoryNX1980")));
std::cout << "=> " << inOutputFileName.c_str() << std::endl;
return dtkNoError;
}
//end_of_ugwsample24
// ----------------------------------------------------------------------------------------------
//start_of_ugwsample25
//! \brief Sample 2.5: writes a cube with a custom NX color table (217 entries) and then writes colored bodies.
Dtk_ErrorStatus UgwColors(const Dtk_string& inOutputFileName, int inVersion)
{
CHECK_OK(Ugw::InitFile(inOutputFileName, inVersion));
for (int colorIdx = 0; colorIdx < 217; colorIdx++)
{
Dtk_string name = "Datakit_";
name.add_int(colorIdx);
Dtk_RGB rgb = Dtk_RGB(colorIdx + 30, 0, 0);
CHECK_OK(Ugw::SetColorInTable(colorIdx, rgb, name));
}
std::cout << "=> " << inOutputFileName.c_str() << std::endl;
return dtkNoError;
}
//end_of_ugwsample25
// ----------------------------------------------------------------------------------------------
//start_of_ugwsample31
Dtk_InfoPtr MakeInstanceData(const Dtk_string& inInstanceName, const Dtk_RGB& inColor, bool inVisible, int inLayer)
{
infos->SetName(inInstanceName);
infos->SetColor(inColor);
if (!inVisible)
infos->SetBlankedStatus(1);
if (inLayer != -1)
infos->SetLayer(inLayer);
return infos;
}
//! \brief Sample 3.1: writes a multi-level NX assembly with named instances, colors, layers, re-instancing and wireframe.
Dtk_ErrorStatus UgwAsm(const Dtk_string& inOutputFileName, int inVersion)
{
Dtk_BodyPtr CubeBody = sampleWriter::CreateCube(); // get a brepcube (common sample)
Dtk_MeshPtr CubeMesh = sampleWriter::CreateMeshCylinder(8); // get a meshcube (common sample)
Dtk_BodyPtr WireBody = sampleWriter::CreateCurves(); // get wire curve into a body.
CubeMesh->Transform(Dtk_transfo(Dtk_dir(30, 0, 0), Dtk_dir(0, 30, 0), Dtk_dir(0, 0, 30), Dtk_pnt())); // rescale mesh too small
Dtk_transfo cubetransfo; // identity
CHECK_OK(Ugw::InitFile(inOutputFileName, inVersion)); // create root prt file
CHECK_OK(Ugw::OpenInstance("sub1", cubetransfo, MakeInstanceData("SubAssembly", Dtk_RGB(), true, -1))); // sub1 subassembly
CHECK_OK(Ugw::WriteBody(CubeBody)); // put a cube on the subassembly
cubetransfo.addTranslate(Dtk_dir(350, 0, 0)); // shift matrix.
CHECK_OK(Ugw::OpenInstance("leaf1", cubetransfo, MakeInstanceData("RedCube_SpecificLayer12", Dtk_RGB(255, 0, 0), true, 12)));
cubetransfo.addTranslate(Dtk_dir(150, 0, 0)); // shift matrix.
CHECK_OK(Ugw::OpenInstance("leaf2", cubetransfo, MakeInstanceData("GreenCube_Transparent", Dtk_RGB(0, 255, 0, 128), true, -1)));
// create a second instance of "leaf2.prt", reusing "leaf2.prt" automatic retrieve instance
cubetransfo.addTranslate(Dtk_dir(150, 0, 0)); // shift matrix.
CHECK_OK(Ugw::OpenInstance("leaf2", cubetransfo, MakeInstanceData("ReinstanciedBlueCube", Dtk_RGB(0, 0, 255), true, -1)));
CHECK_OK(Ugw::CloseLastInstance()); // for reinstance, close immediatly
cubetransfo.addTranslate(Dtk_dir(150, 0, 0)); // shift matrix again
CHECK_OK(Ugw::OpenInstance("leaf3", cubetransfo, MakeInstanceData("TealCube_Invisible", Dtk_RGB(0, 255, 255), false, -1)));
CHECK_OK(Ugw::CloseLastInstance()); // for reinstance, close immediatly
cubetransfo.addTranslate(Dtk_dir(150, 0, 0)); // shift matrix.
CHECK_OK(Ugw::OpenInstance("leaf4", cubetransfo, MakeInstanceData("MeshCyl", Dtk_RGB(), true, -1)));
cubetransfo.addTranslate(Dtk_dir(150, 0, 0)); // shift matrix.
CHECK_OK(Ugw::OpenInstance("leaf5", cubetransfo, MakeInstanceData("Wire", Dtk_RGB(), true, -1)));
CHECK_OK(Ugw::EndFile()); // close root prt file
std::cout << "=> " << inOutputFileName.c_str() << std::endl;
return dtkNoError;
}
//end_of_ugwsample31
// ----------------------------------------------------------------------------------------------
//start_of_ugwsample32
//#define USE_NX_READER
#ifdef USE_NX_READER
extern void nxreader_GetData(const Dtk_string&, void*&);
#define NX_RETRIEVE_ASSEMBLYDATA nxreader_GetData
#else
#define NX_RETRIEVE_ASSEMBLYDATA NULL
#endif
//! \brief Sample 3.2: writes an NX assembly referencing previously written external .prt files.
Dtk_ErrorStatus UgwExternAsm(const Dtk_string& inOutputFileName, int inVersion)
{
// This example create an assembly from extern prt files
// First we initialize writing with name of output file (see macro CHECK_OK above)
CHECK_OK(Ugw::InitFile(inOutputFileName, inVersion));
// We add extern twobodies (.prt) written by this sample previously
// The last parameter is a pointer on a function from datakit NXreader to retrieve subassembly datas : (instance names, colors, layer, visbility).
// This is optional, if NULL is given, the current file doesn't know these datas from subassemblies.
Dtk_transfo trans;
trans.addTranslate(Dtk_dir(0, 0, 200));
// We add extern asm (.prt) written by this sample previously
// We transmit function nxreader_GetData from NXReader, to retrieve cube colors set in subassembly sub1.prt
CHECK_OK(Ugw::AddExternInstance("asm", trans, MakeInstanceData("FirstInstance", Dtk_RGB(), true, 5), NX_RETRIEVE_ASSEMBLYDATA));
trans.addTranslate(Dtk_dir(0, 200, 0));
// We add a second time extern asm (.prt) written by this sample previously
CHECK_OK(Ugw::AddExternInstance("asm", trans, MakeInstanceData("SecondInstance", Dtk_RGB(), true, 15), NX_RETRIEVE_ASSEMBLYDATA));
// Write final file and release the writer.
std::cout << "=> " << inOutputFileName.c_str() << std::endl;
return dtkNoError;
}
//end_of_ugwsample32
// ----------------------------------------------------------------------------------------
//start_of_ugwsample41
{
// text informations
Dtk_TextStyle textstyle;
// All datas below match NX menu Note Settings/ lettering
textinfos->AddAttribute("NX_AlignmentPosition", 4); // optional (1=TL,2=TC,3=TR,4=ML(def),5=MC,6=MR,7=BL,8=BC,9=BR)
textstyle.Justification() = Dtk_TextStyle::JustificationLeft; // Text Justification
textinfos->SetCurveThickNessInMM(0.1); // optional, assume <0.5 = thin, >1.0 = thick else normal
textstyle.CharHeight() = 11; // mandatory height
textinfos->AddAttribute("NX_FontGapFactor", 0.0); // optional (def 0.0)
textstyle.Ratio() = 1.0; // optional Text Aspect Ratio
textinfos->AddAttribute("NX_LineGapFactor", 1.0);// optional (def 1.0)
textinfos->AddAttribute("NX_LetteringAngle", 0.0);// optional (def 0.0)
textinfos->AddAttribute("NX_HeightFactor", 2.0); // optional (def 2.0)
textinfos->SetColor(Dtk_RGB(255, 0, 0)); // optional, a red text
//textstyle.Font().Name() = "Arial"; // optional, defaut blockfont (strokefont).
// NX5 supports only "blockfont", "Arial" and "NX ANSI Symbols"
// NX1980, append font name in table
Dtk_pnt textorigin2D = Dtk_pnt(100, 20, 0); // all location are defined a 2D Coordinate system where Z = 0.
Dtk_Oriented2dBBox textbbox(textorigin2D, -1, -1); // -1 for width if unknown, height is given by textstyle.CharHeight()
Dtk_Text text("SampleText\nsub1\nsub2", textbbox, textbbox, DTK_PI / 2.0, 0, dtk_text_type_value, textinfos, textstyle);
Dtk_CompositeText compotext;
compotext.AddText(text);
symb->Texts() = compotext;
// arrow, see menu in NX : Note Settings / ArrowHead
Dtk_pnt arrowlocation = Dtk_pnt(50, 0, 0); // all location are defined a 2D Coordinate system where Z = 0.
double arrowlength = 5.5; // length of arrow througt line
Dtk_LeaderPtr leader = Dtk_Leader::Create(arrowlength, 0.0, arrowlocation, arrowtype, Dtk_tab<Dtk_pnt>());
// Note Settings / ArrowLine
leader->GetInfo()->SetColor(Dtk_RGB(0, 0, 255)); // optional, a blue leader
leader->GetInfo()->SetCurveThickNessInMM(0.7); // optional, assume <0.5 = thin, >1.0 = thick else normal
leader->GetInfo()->SetCurveLineType(DTK_PHANTOM); // optional, see enum enum Dtk_FontLineType
leader->GetInfo()->AddAttribute("NX_TextToLineGap", 10.0);// optional (def = 10.0)
leader->GetInfo()->AddAttribute("NX_TextOverStubFactor", 0.1);// optional (def = 0.1)
// Note Settings
leader->GetInfo()->AddAttribute("NX_StubLength", 20.0); // optional (def = 20.0)
leader->GetInfo()->AddAttribute("NX_StubSide", 1); // optional 1 for left (default), 0 for right
leader->GetInfo()->AddAttribute("NX_TextAlignment", 1); // optional 1 for top (default), 2 for middle, 3 for bottom
// Note Settings / ArrowHead
leader->GetArrowHead().GetInfo()->AddAttribute("NX_ArrowAngle", 30.0); // optional length given above (def = 30)
leader->GetArrowHead().GetInfo()->AddAttribute("NX_DotDiameter", 1.5); // optional (def = 1.5)
leader->GetArrowHead().GetInfo()->SetColor(Dtk_RGB(255, 0, 255)); // optional, a purple arrow
leader->GetArrowHead().GetInfo()->SetCurveThickNessInMM(2.0); // optional, assume <0.5 = thin, >1.0 = thick else normal
leader->GetArrowHead().GetInfo()->SetCurveLineType(DTK_SOLIDLINE); // optional, see enum enum Dtk_FontLineType
symb->AddLeader(leader);
// Final Placement :
Dtk_dir X(0, 0, 1);
Dtk_dir Y(-1, 0, 0);
Dtk_pnt O(0, 0, 0);
Dtk_transfo trans = Dtk_transfo(X, Y, X^Y, O);
pmi->info() = Dtk_Info::Create();
pmi->info()->SetName("MyAnnot");
return pmi;
}
//! \brief Sample 4.1: writes a cube body and a PMI annotation (symbol with leader) into an NX file.
Dtk_ErrorStatus UgwAnnot(const Dtk_string& inOutputFileName, int inVersion)
{
// Cube Sample
// First we initialize writing with name of output file (see macro CHECK_OK above)
CHECK_OK(Ugw::InitFile(inOutputFileName, inVersion));
// Then we write the 2 bodies constructed
// Write final file and release the writer.
std::cout << "=> " << inOutputFileName.c_str() << std::endl;
return dtkNoError;
}
//end_of_ugwsample41
// -----------------------------------------------------------------
//! \brief Entry point: runs all UGW sample functions for the given NX format version and output directory.
Dtk_ErrorStatus UgWriteSampleVersion(const Dtk_string &inOutputDirectory, int inVersion)
{
Dtk_string currentOutputFile;
Dtk_ErrorStatus errorStatus;
// sample 1.1 : one body
currentOutputFile = inOutputDirectory + L"simplebody.prt";
errorStatus = UgwSimpleBody(currentOutputFile, inVersion);
// sample 1.2 : just write 2 bodies
currentOutputFile = inOutputDirectory + L"twobodies.prt";
errorStatus = UgwTwoBodies(currentOutputFile, inVersion);
// sample 1.3 : mesh
currentOutputFile = inOutputDirectory + L"mesh.prt";
errorStatus = UgwMesh(currentOutputFile, inVersion);
// sample 1.4 : wire
currentOutputFile = inOutputDirectory + L"wire.prt";
errorStatus = UgwWire(currentOutputFile, inVersion);
// sample 1.5 : References
currentOutputFile = inOutputDirectory + L"refs.prt";
errorStatus = UgwReferences(currentOutputFile, inVersion);
// sample 1.6 : Extern Parasolid
currentOutputFile = inOutputDirectory + L"extparasolid.prt";
errorStatus = UgwExternParasolid(currentOutputFile, "../InputFiles/Models/Parasolid/extparasolid.x_b", inVersion);
// sample 1.7 : Extern JT
currentOutputFile = inOutputDirectory + L"extjt.prt";
errorStatus = UgwExternJTMesh(currentOutputFile, "../InputFiles/Models/JT/externjt.jt", inVersion);
// sample 2.1 : Layer filters
currentOutputFile = inOutputDirectory + L"layers.prt";
errorStatus = UgwLayers(currentOutputFile, inVersion);
// sample 2.2 : Groups
currentOutputFile = inOutputDirectory + L"groups.prt";
errorStatus = UgwGroups(currentOutputFile, inVersion);
// sample 2.3 : Reference Sets
currentOutputFile = inOutputDirectory + L"refsets.prt";
errorStatus = UgwRefSets(currentOutputFile, inVersion);
// sample 2.4 : MetaDatas, units, modeling preferences
currentOutputFile = inOutputDirectory + L"meta.prt";
errorStatus = UgwMeta(currentOutputFile, inVersion);
// sample 2.5 : Colors
currentOutputFile = inOutputDirectory + L"colors.prt";
errorStatus = UgwColors(currentOutputFile, inVersion);
// sample 3.1 : Simple Assembly
currentOutputFile = inOutputDirectory + L"asm.prt";
errorStatus = UgwAsm(currentOutputFile, inVersion);
// sample 3.2 : Extern Assembly
currentOutputFile = inOutputDirectory + L"externasm.prt";
errorStatus = UgwExternAsm(currentOutputFile, inVersion);
// sample 4.1 : Annotation
currentOutputFile = inOutputDirectory + L"annot.prt";
errorStatus = UgwAnnot(currentOutputFile, inVersion);
return errorStatus;
}
// -----------------------------------------------------------------
//start_of_mainugwrite
DtkErrorStatus UgWriteSample(const Dtk_string &inResultDirectory)
{
Dtk_string inOutputDirectory, nxDirectory;
Dtk_ErrorStatus errorStatus;
std::cout << std::endl << "----------------------------------------------" << std::endl;
std::cout << "Ug Write start" << std::endl;
nxDirectory = inResultDirectory + L"NX-Unigraphics/";
nxDirectory.FixPathSeparator();
nxDirectory.mkdir();
// Choosing output for inVersion NX5
inOutputDirectory = inResultDirectory + L"NX-Unigraphics/nx5/";
inOutputDirectory.FixPathSeparator();
inOutputDirectory.mkdir();
errorStatus = UgWriteSampleVersion(inOutputDirectory, DTK_UGW_VERSION_NX5);
// Choosing output for inVersion NX1980
inOutputDirectory = inResultDirectory + L"NX-Unigraphics/nx1980/";
inOutputDirectory.FixPathSeparator();
inOutputDirectory.mkdir();
errorStatus = UgWriteSampleVersion(inOutputDirectory, DTK_UGW_VERSION_NX1980);
// Choosing output for inVersion NX2212
inOutputDirectory = inResultDirectory + L"NX-Unigraphics/nx2212/";
inOutputDirectory.FixPathSeparator();
inOutputDirectory.mkdir();
errorStatus = UgWriteSampleVersion(inOutputDirectory, DTK_UGW_VERSION_NX2212);
std::cout << "Ug Write end" << std::endl;
return errorStatus;
}
//end_of_mainugwrite_dtk
Dtk_Info::Create
static Dtk_SmartPtr< Dtk_Info > Create()
Calls default constructor to allocate a new object.
Dtk_TextStyle::Ratio
Dtk_Double64 & Ratio()
Retrieves the text ratio - get/set -.
Dtk_InfoPtr
Dtk_SmartPtr< Dtk_Info > Dtk_InfoPtr
Handles a Dtk_Info object.
Definition: util_ptr_dtk.hpp:312
Ugw::DefaultParameters
Definition: ugw.hpp:14
Dtk_transfo
This is the Transformation dedicated class.
Definition: dtk_transfo.hpp:19
Ugw::DefaultParameters::ObjectPreferences::solid_body
General solid_body
Definition: ugw.hpp:45
Ugw::WriteAxisSystem
Dtk_ErrorStatus WriteAxisSystem(const Dtk_AxisSystemPtr &inAxisSystem)
Add an axis system into the current node.
MakeRefAxis
Dtk_BodyPtr MakeRefAxis()
Definition: testlibugwrite.cpp:155
Dtk_TextStyle::Justification
TextJustificationEnum & Justification()
Retrieves the text justification - get/set -.
Dtk_Info::AddAttribute
Dtk_ErrorStatus AddAttribute(Dtk_string name, Dtk_Val val)
Dtk_TextStyle::JustificationLeft
@ JustificationLeft
Definition: util_draw_dtk.hpp:281
Ugw::DefaultParameters::objectpreferences
ObjectPreferences objectpreferences
Definition: ugw.hpp:52
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.
Dtk_Info::SetName
Dtk_ErrorStatus SetName(Dtk_string inName)
Ugw::SetColorInTable
Dtk_ErrorStatus SetColorInTable(size_t inIth, const Dtk_RGB &inColor, const Dtk_string &inColorname)
Replace color value and color name on the palette.
Dtk_TextStyle
This is the text_style. This class gathers information about text style.
Definition: util_draw_dtk.hpp:242
dtkErrorFileNotExist
@ dtkErrorFileNotExist
Definition: error_dtk.hpp:103
MakeRefPlane
Dtk_BodyPtr MakeRefPlane()
Definition: testlibugwrite.cpp:121
Ugw::SetLayerData
Dtk_ErrorStatus SetLayerData(const Dtk_LayerInfosSetPtr &inLayerDataSet, const Dtk_tab< Dtk_Int32 > &unused1=Dtk_tab< Dtk_Int32 >(), const Dtk_tab< Dtk_Int32 > &unused2=Dtk_tab< Dtk_Int32 >())
define Data for layers
Ugw::AddExternInstance
Dtk_ErrorStatus AddExternInstance(const Dtk_string &inProtoFileName, const Dtk_transfo &inTrans, Dtk_InfoPtr inInfos, void(*innxread_getdata)(const Dtk_string &, void *&))
Open an extern file to add as instance in current assembly, inProtoFileName must be in the output dir...
UgwSimpleBody
Dtk_ErrorStatus UgwSimpleBody(const Dtk_string &inOutputFileName, int inVersion)
Sample 1.1: writes a single BRep cube body into an NX file.
Definition: testlibugwrite.cpp:18
UgwReferences
Dtk_ErrorStatus UgwReferences(const Dtk_string &inOutputFileName, int inVersion)
Definition: testlibugwrite.cpp:186
DTK_TRUE
#define DTK_TRUE
Definition: define.h:726
UgwRefSets
Dtk_ErrorStatus UgwRefSets(const Dtk_string &inOutputFileName, int inVersion)
Sample 2.3: writes bodies assigned to NX reference sets via the NXREFERENCESET attribute.
Definition: testlibugwrite.cpp:374
DTK_UGW_VERSION_NX5
#define DTK_UGW_VERSION_NX5
Definition: ugw.hpp:7
dtk_text_type_value
@ dtk_text_type_value
Definition: str_def.h:14
Dtk_string
This is a high level string class.
Definition: dtk_string.hpp:53
UgwTwoBodies
Dtk_ErrorStatus UgwTwoBodies(const Dtk_string &inOutputFileName, int inVersion)
Sample 1.2: writes two named cubes (translated apart) into an NX file.
Definition: testlibugwrite.cpp:44
Ugw::WriteReferenceGeometry
Dtk_ErrorStatus WriteReferenceGeometry(const Dtk_BodyPtr &inRefgeom)
Add a reference geometry into the current node.
UgWriteSampleVersion
Dtk_ErrorStatus UgWriteSampleVersion(const Dtk_string &inOutputDirectory, int inVersion)
Entry point: runs all UGW sample functions for the given NX format version and output directory.
Definition: testlibugwrite.cpp:679
UgwExternJTMesh
Dtk_ErrorStatus UgwExternJTMesh(const Dtk_string &inOutputFileName, const Dtk_string &inJtFilePath, int inVersion)
Sample 1.7: embeds an existing JT mesh stream into an NX file as external reference.
Definition: testlibugwrite.cpp:248
Ugw::WriteExternJtMesh
Dtk_ErrorStatus WriteExternJtMesh(const char *inFlux, size_t inSize, const Dtk_InfoPtr &inInf)
Add a JT file as lightweight body inside the file.
Dtk_Text
This is the base text class. It's part of Dtk_CompositeText. This class represents the texts and valu...
Definition: util_draw_dtk.hpp:1041
UgwMesh
Dtk_ErrorStatus UgwMesh(const Dtk_string &inOutputFileName, int inVersion)
Sample 1.3: writes a cylinder mesh into an NX file.
Definition: testlibugwrite.cpp:77
Dtk_Body::Create
static Dtk_BodyPtr Create()
Create a body.
Ugw::WriteBody
Dtk_ErrorStatus WriteBody(const Dtk_BodyPtr &inBody)
Add a body inside the file.
UgwWire
Dtk_ErrorStatus UgwWire(const Dtk_string &inOutputFileName, int inVersion)
Sample 1.4: writes a wireframe body (curves) into an NX file.
Definition: testlibugwrite.cpp:93
Dtk_string::OpenFile
FILE * OpenFile(const Dtk_string &inRights) const
File Utility : Open a file with the given rights.
MakeFixedRefPlane
Dtk_BodyPtr MakeFixedRefPlane()
Definition: testlibugwrite.cpp:137
DTK_SOLIDLINE
@ DTK_SOLIDLINE
Definition: util_ent_dtk.hpp:49
Dtk_Symbol::Create
static Dtk_SymbolPtr Create()
Calls default constructor to allocate a new object.
Dtk_Info::SetBlankedStatus
Dtk_ErrorStatus SetBlankedStatus(const Dtk_Int32 &inBlankedStatus)
UgwGroups
Dtk_ErrorStatus UgwGroups(const Dtk_string &inOutputFileName, int inVersion)
Sample 2.2: writes bodies and a mesh grouped under named entity groups.
Definition: testlibugwrite.cpp:314
Dtk_string::add_int
void add_int(const int integer, int force_unsigned_int=0)
concat an int to the Dtk_string (convert the int to Dtk_string)
Dtk_Val
Definition: dtk_val.hpp:67
Dtk_Face::Create
static Dtk_FacePtr Create(const Dtk_BodyPtr &inParentBody)
Create a face in a body.
UGW_Sample_MakePMI
Dtk_FdtPtr UGW_Sample_MakePMI()
Definition: testlibugwrite.cpp:587
MakeAxisSystem
Dtk_AxisSystemPtr MakeAxisSystem()
Definition: testlibugwrite.cpp:109
MakeInstanceData
Dtk_InfoPtr MakeInstanceData(const Dtk_string &inInstanceName, const Dtk_RGB &inColor, bool inVisible, int inLayer)
Definition: testlibugwrite.cpp:474
Ugw::DefaultParameters::ModelingPreferences::distance_tolerance
double distance_tolerance
Definition: ugw.hpp:23
Dtk_AxisSystem::Create
static Dtk_SmartPtr< Dtk_AxisSystem > Create()
Calls default constructor to allocate a new object.
Dtk_tab::resize
void resize(Dtk_Size_t n, const T &t)
Resizes the array.
Definition: util_stl_dtk.hpp:604
UgwLayers
Dtk_ErrorStatus UgwLayers(const Dtk_string &inOutputFileName, int inVersion)
Sample 2.1: writes a cube and a cylinder mesh each assigned to specific layers, with layer info set.
Definition: testlibugwrite.cpp:283
Ugw::WritePMI
Dtk_ErrorStatus WritePMI(const Dtk_FdtPtr &inPmi)
Add a pmi inside the file.
Ugw::WriteExternParasolidBody
Dtk_ErrorStatus WriteExternParasolidBody(const char *inFlux, size_t inSize, const Dtk_InfoPtr &inInf)
Add a Parasolid file as body inside the file.
UgwExternAsm
Dtk_ErrorStatus UgwExternAsm(const Dtk_string &inOutputFileName, int inVersion)
Sample 3.2: writes an NX assembly referencing previously written external .prt files.
Definition: testlibugwrite.cpp:553
UgwAsm
Dtk_ErrorStatus UgwAsm(const Dtk_string &inOutputFileName, int inVersion)
Sample 3.1: writes a multi-level NX assembly with named instances, colors, layers,...
Definition: testlibugwrite.cpp:487
Dtk_MetaData::TypeProperty
@ TypeProperty
Definition: dtk_metadata.hpp:29
Ugw::CloseLastInstance
Dtk_ErrorStatus CloseLastInstance()
Close the last instance.
Ugw::DefaultParameters::background_color_top
Dtk_RGB background_color_top
Definition: ugw.hpp:36
DTK_PHANTOM
@ DTK_PHANTOM
Definition: util_ent_dtk.hpp:53
Ugw::SetGroupDatas
Dtk_ErrorStatus SetGroupDatas(const Dtk_string &inGroupName, Dtk_InfoPtr inInfos)
define Visibility for a specific group
Dtk_SmartPtr::DtkDynamicCast
static Dtk_SmartPtr< T > DtkDynamicCast(const Dtk_SmartPtr< T2 > &p)
Definition: util_ptr_dtk.hpp:101
Dtk_Info::SetCurveThickNessInMM
Dtk_ErrorStatus SetCurveThickNessInMM(const Dtk_Double64 inCurveThickNessInMM)
UgWriteSample
DtkErrorStatus UgWriteSample(const Dtk_string &inResultDirectory)
Definition: testlibugwrite.cpp:751
Dtk_ErrorStatus
Dtk_ErrorStatus
Definition: error_dtk.hpp:6
Ugw::DefaultParameters::ObjectPreferences::def
General def
Definition: ugw.hpp:45
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.
UgwMeta
Dtk_ErrorStatus UgwMeta(const Dtk_string &inOutputFileName, int inVersion)
Sample 2.4: writes a cube with metadata (properties in categories) and custom unit/tolerance defaults...
Definition: testlibugwrite.cpp:414
sampleWriter::layer::CreateSetWithFlagsAndFilters
Dtk_LayerInfosSetPtr CreateSetWithFlagsAndFilters()
Creates a layer info set with 257 layers (indices 0-256), alternating visible/selectable flags,...
Definition: testcreatelayerinfoset.cpp:81
CHECK_OK
#define CHECK_OK(X)
Definition: testwriters.h:8
Dtk_SmartPtr
Definition: util_ptr_dtk.hpp:37
MakeMetaData
Dtk_MetaDataPtr MakeMetaData(const Dtk_string &inPropertyName, const Dtk_string &inValue, const Dtk_string &inCategory="")
Definition: testlibugwrite.cpp:406
Dtk_string::c_str
const char * c_str() const
Retrieve the ASCII conversion string.
Dtk_Point::Create
static Dtk_PointPtr Create(const Dtk_Point &in)
Calls copy constructor to allocate a new object.
sampleWriter::CreateMeshCylinder
Dtk_MeshPtr CreateMeshCylinder(int nbpoints)
Mesh Cylinder sample.
Definition: testcreatemesh.cpp:338
Ugw::DefaultParameters::background_color_bottom
Dtk_RGB background_color_bottom
Definition: ugw.hpp:36
Ugw::DefaultParameters::modelingpreferences
ModelingPreferences modelingpreferences
Definition: ugw.hpp:35
Dtk_string::mkdir
int mkdir() const
File Utility : Create a Directory.
Dtk_Info::SetLayer
Dtk_ErrorStatus SetLayer(const Dtk_Int32 &inLayer)
Dtk_pnt
This is a mathematical point class.
Definition: dtk_pnt.hpp:20
Ugw::DefaultParameters::unit
Unit unit
Definition: ugw.hpp:19
Dtk_string::FixPathSeparator
void FixPathSeparator()
File Utility : Fixes path separator consistency. It lets you replace the '\' or '/' by the OS needed ...
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:1445
Ugw::DefaultParameters::ModelingPreferences::density
double density
Definition: ugw.hpp:25
Ugw::DefaultParameters::ModelingPreferences::density_unit
DensityUnit density_unit
Definition: ugw.hpp:30
datakit.h
UgwColors
Dtk_ErrorStatus UgwColors(const Dtk_string &inOutputFileName, int inVersion)
Sample 2.5: writes a cube with a custom NX color table (217 entries) and then writes colored bodies.
Definition: testlibugwrite.cpp:449
Ugw::DefaultParameters::ModelingPreferences::lb_ft3
@ lb_ft3
Definition: ugw.hpp:28
Dtk_Leader::Create
static Dtk_LeaderPtr Create()
Calls default constructor to allocate a new object.
Dtk_Line::Create
static Dtk_LinePtr Create(const Dtk_Line &in)
Calls copy constructor to allocate a new object.
testcreatemesh.hpp
testcreatecube.hpp
Dtk_TextStyle::CharHeight
Dtk_Double64 & CharHeight()
Retrieves the char height - get/set -.
NX_RETRIEVE_ASSEMBLYDATA
#define NX_RETRIEVE_ASSEMBLYDATA
Definition: testlibugwrite.cpp:548
Dtk_tab
This is a high level array class.
Definition: util_stl_dtk.hpp:84
Ugw::WriteMesh
Dtk_ErrorStatus WriteMesh(const Dtk_MeshPtr &inMesh)
Add a mesh inside the file.
Dtk_transfo::addTranslate
void addTranslate(const Dtk_dir &V)
Translate the Dtk_transfo.
sampleWriter::CreateCube
Dtk_BodyPtr CreateCube()
Creates a 100x100x100 mm closed BRep cube body. Builds the full BRep hierarchy (Vertex,...
Definition: testcreatecube.cpp:1325
Dtk_tab::size
Dtk_Size_t size() const
Returns the size of the array.
Definition: util_stl_dtk.hpp:503
Ugw::AddMetaData
Dtk_ErrorStatus AddMetaData(const Dtk_MetaDataPtr &inMeta)
Add a MetaData in the current component.
DTK_UGW_VERSION_NX1980
#define DTK_UGW_VERSION_NX1980
Definition: ugw.hpp:8
ugw.hpp
Ugw::InitFile
Dtk_ErrorStatus InitFile(const Dtk_string &inFilename, int inVersiontowrite=45, const DefaultParameters &inDef=DefaultParameters())
Initialize UG Writer.
Ugw::OpenInstance
Dtk_ErrorStatus OpenInstance(const Dtk_string &inInstanceName, const Dtk_string &inProtoFileName, Dtk_bool &outWasAlreadyInstancied, const Dtk_transfo &inTrans, const Dtk_RGB &inRgb)
deprecated
DTK_RB
#define DTK_RB
Definition: dtk_string.hpp:35
Ugw::DefaultParameters::ModelingPreferences::angle_tolerance
double angle_tolerance
Definition: ugw.hpp:24
Dtk_Leader::LeaderTerminatorTypeEnum
LeaderTerminatorTypeEnum
Internal leader terminator type.
Definition: util_draw_dtk.hpp:1852
Ugw::DefaultParameters::ObjectPreferences::General::width
Dtk_Double64 width
Definition: ugw.hpp:42
sampleWriter::CreateCurves
Dtk_BodyPtr CreateCurves()
Creates a wireframe body containing a circle, ellipse, line, and NURBS curve, each with a distinct co...
Definition: testcreatecube.cpp:1368
UgwExternParasolid
Dtk_ErrorStatus UgwExternParasolid(const Dtk_string &inOutputFileName, const Dtk_string &inParasolidFilePath, int inVersion)
Sample 1.6: embeds an existing Parasolid binary stream into an NX file as an external reference.
Definition: testlibugwrite.cpp:213
dtkNoError
@ dtkNoError
Definition: error_dtk.hpp:151
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.
MakeRefPoint
Dtk_BodyPtr MakeRefPoint()
Definition: testlibugwrite.cpp:171
testwriters.h
Dtk_CompositeText::AddText
void AddText(Dtk_Text inText)
Adds a Dtk_Text to the Dtk_CompositeText.
Dtk_RGB
Definition: dtk_rgb.hpp:8
Dtk_Info::SetColor
Dtk_ErrorStatus SetColor(const int &R, const int &G, const int &B)
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:450
testcreatelayerinfoset.hpp
Dtk_dir
This is a mathematical direction class.
Definition: dtk_dir.hpp:14
DTK_UGW_VERSION_NX2212
#define DTK_UGW_VERSION_NX2212
Definition: ugw.hpp:9
Dtk_Leader::TerminatorTypeFillArrow
@ TerminatorTypeFillArrow
Definition: util_draw_dtk.hpp:1860
Ugw::EndFile
Dtk_ErrorStatus EndFile()
Close the UG file.
UgwAnnot
Dtk_ErrorStatus UgwAnnot(const Dtk_string &inOutputFileName, int inVersion)
Sample 4.1: writes a cube body and a PMI annotation (symbol with leader) into an NX file.
Definition: testlibugwrite.cpp:654
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_PI
#define DTK_PI
Definition: str_def.h:8