Hoops Visualize HPS  version 2018-SP2
Hoops Visualize HPS 3D Rendering Engine
Looking for a senior C++ dev?
I'm looking for work. Hire me!
HPS::World Class Reference

The World class is a special object that must be constructed prior to making any database calls and must exist for the life of the application. More...

#include <hps.h>

Inheritance diagram for HPS::World:
Collaboration diagram for HPS::World:

Public Member Functions

 World (char const *in_license, char const *in_code_generation_directory=nullptr)
 This constructor creates a new World object with the given license. More...
 
 ~World ()
 The destructor will shutdown the database and invalidate all objects within it. More...
 
HPS::Type ObjectType () const
 
WorldSetMaterialLibraryDirectory (char const *in_directory)
 Sets the directory which contains the material library for Visualize. More...
 
WorldSetFontDirectory (char const *in_directory)
 Sets the directory which contains fonts for use by Visualize. More...
 
WorldSetFontDirectories (size_t in_count, UTF8 const in_directories[])
 Sets the directories which contain fonts for use by Visualize. More...
 
WorldSetFontDirectories (UTF8Array const &in_directories)
 Sets the directories which contain fonts for use by Visualize. More...
 
WorldSetDriverConfigFile (char const *in_filename)
 Sets the driver configuration file (i.e., a plain text file which can force device specific behavior) for Visualize. More...
 
WorldSetExchangeLibraryDirectory (char const *in_directory)
 Sets the directory which contains the Exchange and Publish libraries. More...
 
WorldSetPublishResourceDirectory (char const *in_directory)
 Sets the resource directory for Publish. More...
 
WorldSetParasolidSchemaDirectory (char const *in_directory)
 Sets the schema directory for Parasolid. More...
 
WorldSetRealDWGDirectory (char const *in_directory)
 Sets the RealDWG directory. More...
 
WorldSetRealDWGDirectory (char const *in_directory, UTF8Array const &in_object_enabler_directories)
 Sets the RealDWG directory and its related Object Enabler directories. More...
 
WorldSetParasolidBodyshopDirectory (char const *in_directory)
 Sets the Parasolid Bodyshop directory. More...
 
WorldUnsetMaterialLibraryDirectory ()
 Removes the material library directory for Visualize. More...
 
WorldUnsetFontDirectories ()
 Removes the font directories for Visualize. More...
 
WorldUnsetDriverConfigFile ()
 Removes the driver configuration file for Visualize. More...
 
WorldUnsetExchangeLibraryDirectory ()
 Removes the Exchange and Publish library directory. More...
 
WorldUnsetPublishResourceDirectory ()
 Removes the Publish resource directory. More...
 
WorldUnsetParasolidSchemaDirectory ()
 Removes the Parasolid schema directory. More...
 
WorldUnsetRealDWGDirectory ()
 Removes the RealDWG directory and any Object Enabler directories. More...
 
WorldUnsetParasolidBodyshopDirectory ()
 Removes the Parasolid Bodyshop directory. More...
 
bool ShowMaterialLibraryDirectory (UTF8 &out_directory) const
 Shows the material library directory for Visualize. More...
 
bool ShowFontDirectories (UTF8Array &out_directories) const
 Shows the font directories for Visualize. More...
 
bool ShowDriverConfigFile (UTF8 &out_filename) const
 Shows the driver configuration file for Visualize. More...
 
bool ShowExchangeLibraryDirectory (UTF8 &out_directory) const
 Shows the Exchange and Publish library directory. More...
 
bool ShowPublishResourceDirectory (UTF8 &out_directory) const
 Shows the Publish resource directory. More...
 
bool ShowParasolidSchemaDirectory (UTF8 &out_directory) const
 Shows the Parasolid schema directory. More...
 
bool ShowRealDWGDirectory (UTF8 &out_directory, UTF8Array &out_object_enabler_directories) const
 Shows the RealDWG directory and any related Object Enabler directories. More...
 
bool ShowParasolidBodyshopDirectory (UTF8 &out_directory) const
 Shows the Parasolid Bodyshop directory. More...
 
virtual HPS::Type Type () const
 This function returns the true type of the underlying object. More...
 
virtual bool Empty () const
 Indicates whether this object has any values set on it. More...
 
bool HasType (HPS::Type in_mask) const
 This function indicates whether this Object has the given Type mask. More...
 
intptr_t GetClassID () const
 Returns a unique identifier that is shared by all objects of the same class. More...
 
intptr_t GetInstanceID () const
 Returns an identifier that can be used to identify which instance of a class an object is. More...
 

Static Public Member Functions

static void AddCodeGenerationComment (UTF8 const &in_comment)
 Adds a comment to the generated code. More...
 
static void StopCodeGeneration ()
 Stops Code Generation. More...
 
template<typename T >
static intptr_t ClassID ()
 Unique identifier for this class. More...
 

Static Public Attributes

static const HPS::Type staticType = HPS::Type::World
 

Private Member Functions

 World ()
 Private default constructor to prevent instantiation without license. More...
 
virtual void Reset ()
 Not available here. More...
 

Detailed Description

The World class is a special object that must be constructed prior to making any database calls and must exist for the life of the application.

Constructor & Destructor Documentation

◆ World() [1/2]

HPS::World::World ( char const *  in_license,
char const *  in_code_generation_directory = nullptr 
)

This constructor creates a new World object with the given license.

The license string determines what functionality is available in Visualize. There should only be one World object that is constructed during the life of the application. Optionally it is possible to start Code Generation, which logs every call to the HPS API for debugging purposes. While Code Generation is active, HPS performance will be slower than usual.

Parameters
in_licenseUTF8-encoded license string for Visualize.
in_code_generation_directoryUTF8-encoded directory where the output of Code Generation will be stored. The directory must already exist.

◆ ~World()

HPS::World::~World ( )

The destructor will shutdown the database and invalidate all objects within it.

◆ World() [2/2]

HPS::World::World ( )
private

Private default constructor to prevent instantiation without license.

Member Function Documentation

◆ AddCodeGenerationComment()

static void HPS::World::AddCodeGenerationComment ( UTF8 const &  in_comment)
static

Adds a comment to the generated code.

Useful to guide a developer towards the source of a problem. Code Generation must be started before this function can be called.

Parameters
in_commentA comment to be embedded in the code generation.

◆ ClassID()

template<typename T >
static intptr_t HPS::Object::ClassID ( )
inlinestaticinherited

Unique identifier for this class.

Note: this method uses construction of static objects. If used in a constructor, it should be used in the body not the initializer list.

◆ Empty()

virtual bool HPS::Object::Empty ( ) const
inlinevirtualinherited

Indicates whether this object has any values set on it.

Returns
true if no values are set on this object, false otherwise.

Reimplemented in HPS::STL::ImportResultsKit, HPS::STL::ImportOptionsKit, HPS::OBJ::ImportResultsKit, HPS::OBJ::ImportOptionsKit, HPS::Hardcopy::File::ExportOptionsKit, HPS::Stream::ExportOptionsKit, HPS::Stream::ImportResultsKit, HPS::Stream::ImportOptionsKit, HPS::PointCloud::ImportOptionsKit, HPS::PointCloud::ImportResultsKit, HPS::UpdateOptionsKit, HPS::HighlightSearchOptionsKit, HPS::HighlightOptionsKit, HPS::SelectionOptionsKit, HPS::SearchOptionsKit, HPS::CutGeometryGatheringOptionsKit, HPS::ShapeKit, HPS::ShaderKit, HPS::Shader::ImportOptionsKit, HPS::ImageKit, HPS::Image::ImportOptionsKit, HPS::Image::ExportOptionsKit, HPS::TextureOptionsKit, HPS::LinePatternKit, HPS::LinePatternParallelKit, HPS::LinePatternOptionsKit, HPS::GlyphKit, HPS::ApplicationWindowOptionsKit, HPS::OffScreenWindowOptionsKit, HPS::StandAloneWindowOptionsKit, HPS::GridKit, HPS::PolygonKit, HPS::MeshKit, HPS::ShellKit, HPS::ShellRelationResultsKit, HPS::ShellRelationOptionsKit, HPS::ShellOptimizationOptionsKit, HPS::TextKit, HPS::EllipticalArcKit, HPS::EllipseKit, HPS::TrimKit, HPS::NURBSSurfaceKit, HPS::NURBSCurveKit, HPS::SpotlightKit, HPS::InfiniteLineKit, HPS::CuttingSectionKit, HPS::CircularWedgeKit, HPS::CircularArcKit, HPS::CircleKit, HPS::SphereKit, HPS::CylinderKit, HPS::DistantLightKit, HPS::MarkerKit, HPS::LineKit, HPS::AttributeLockKit, HPS::FontInfoState, HPS::WindowInfoKit, HPS::DebuggingKit, HPS::SubwindowKit, HPS::ContourLineKit, HPS::VisualEffectsKit, HPS::TransformMaskKit, HPS::PostProcessEffectsKit, HPS::DrawingAttributeKit, HPS::HiddenLineAttributeKit, HPS::PerformanceKit, HPS::NURBSSurfaceAttributeKit, HPS::MaterialKit, HPS::MaterialMappingKit, HPS::MatrixKit, HPS::CurveAttributeKit, HPS::EdgeAttributeKit, HPS::LineAttributeKit, HPS::TextAttributeKit, HPS::CuttingSectionAttributeKit, HPS::CylinderAttributeKit, HPS::LightingAttributeKit, HPS::SphereAttributeKit, HPS::MarkerAttributeKit, HPS::CullingKit, HPS::ColorInterpolationKit, HPS::TransparencyKit, HPS::SelectabilityKit, HPS::CameraKit, HPS::VisibilityKit, HPS::BoundingKit, HPS::SegmentOptimizationOptionsKit, HPS::Publish::ExportOptionsKit, HPS::Publish::TextFieldKit, HPS::Publish::SignatureFieldKit, HPS::Publish::DropDownListKit, HPS::Exchange::TessellationOptionsKit, HPS::Publish::ListBoxKit, HPS::Exchange::ExportSTEPOptionsKit, HPS::Exchange::ExportParasolidOptionsKit, HPS::Publish::RadioButtonKit, HPS::Exchange::ExportIGESOptionsKit, HPS::Exchange::ExportXMLOptionsKit, HPS::Publish::CheckBoxKit, HPS::Exchange::ExportU3DOptionsKit, HPS::Exchange::ExportSTLOptionsKit, HPS::Publish::ButtonKit, HPS::Exchange::ExportPRCOptionsKit, HPS::Publish::LinkKit, HPS::Exchange::ExportJTOptionsKit, HPS::Publish::SlideTableKit, HPS::Exchange::ExportACISOptionsKit, HPS::Publish::TableKit, HPS::Exchange::Export3MFOptionsKit, HPS::Publish::ImageKit, HPS::Publish::TextKit, HPS::Exchange::ModelFileImportOptionsKit, HPS::Publish::ViewKit, HPS::Exchange::TranslationOptionsKit, HPS::Publish::ArtworkKit, HPS::Publish::AnnotationKit, HPS::ComponentPath, HPS::Exchange::ImportOptionsKit, HPS::Parasolid::ExportOptionsKit, HPS::Exchange::NURBSConversionOptionsKit, HPS::Parasolid::LineTessellationKit, HPS::Exchange::Configuration, HPS::Publish::PageKit, HPS::Parasolid::FacetTessellationKit, HPS::Publish::DocumentKit, HPS::Parasolid::ImportOptionsKit, HPS::DWG::ImportOptionsKit, HPS::OOC::ImportOptionsKit, HPS::Sketchup::ImportOptionsKit, and HPS::Sketchup::ImportResultsKit.

◆ GetClassID()

intptr_t HPS::Object::GetClassID ( ) const
inherited

Returns a unique identifier that is shared by all objects of the same class.

Returns
A unique value shared by all objects of the same class.

◆ GetInstanceID()

intptr_t HPS::Object::GetInstanceID ( ) const
inherited

Returns an identifier that can be used to identify which instance of a class an object is.

Different keys and controls will return the same value if they are backed by the same database resource.

Returns
A value unique to an instance of an object and all objects that are backed by the same database resource.

◆ HasType()

bool HPS::Object::HasType ( HPS::Type  in_mask) const
inherited

This function indicates whether this Object has the given Type mask.

Parameters
in_maskThe Type mask to check against this Object.
Returns
true if this Object has the given Type mask, false otherwise.

◆ ObjectType()

HPS::Type HPS::World::ObjectType ( ) const
inlinevirtual

Reimplemented from HPS::Object.

◆ Reset()

virtual void HPS::World::Reset ( )
inlineprivatevirtual

Not available here.

Reimplemented from HPS::Object.

◆ SetDriverConfigFile()

World& HPS::World::SetDriverConfigFile ( char const *  in_filename)

Sets the driver configuration file (i.e., a plain text file which can force device specific behavior) for Visualize.

To ensure the settings within the configuration file take effect, this file must be specified prior to creating a driver which will be affected by the settings.

Parameters
in_filenameUTF8-encoded file name.
Returns
A reference to this World object.

◆ SetExchangeLibraryDirectory()

World& HPS::World::SetExchangeLibraryDirectory ( char const *  in_directory)

Sets the directory which contains the Exchange and Publish libraries.

If this is set, the Exchange and Publish Visualize modules will try to load the libraries from this directory. If this is not set, those modules will try to load the libraries from the directories in the application's PATH. Note that this function will append the given directory to the PATH.

Parameters
in_directoryUTF8-encoded directory name.
Returns
A reference to this World object.

◆ SetFontDirectories() [1/2]

World& HPS::World::SetFontDirectories ( size_t  in_count,
UTF8 const  in_directories[] 
)

Sets the directories which contain fonts for use by Visualize.

This must be specified for Visualize to make use of any fonts beyond those Visualize defines itself.

Parameters
in_countSize of the following array.
in_directoriesArray of UTF8-encoded directory names.
Returns
A reference to this World object.

◆ SetFontDirectories() [2/2]

World& HPS::World::SetFontDirectories ( UTF8Array const &  in_directories)

Sets the directories which contain fonts for use by Visualize.

This must be specified for Visualize to make use of any fonts beyond those Visualize defines itself.

Parameters
in_directoriesArray of UTF8-encoded directory names.
Returns
A reference to this World object.

◆ SetFontDirectory()

World& HPS::World::SetFontDirectory ( char const *  in_directory)

Sets the directory which contains fonts for use by Visualize.

This must be specified for Visualize to make use of any fonts beyond those Visualize defines itself.

Parameters
in_directoryUTF8-encoded directory name.
Returns
A reference to this World object.

◆ SetMaterialLibraryDirectory()

World& HPS::World::SetMaterialLibraryDirectory ( char const *  in_directory)

Sets the directory which contains the material library for Visualize.

This must be specified to ensure any files which use the material library display correctly.

Parameters
in_directoryUTF8-encoded directory name.
Returns
A reference to this World object.

◆ SetParasolidBodyshopDirectory()

World& HPS::World::SetParasolidBodyshopDirectory ( char const *  in_directory)

Sets the Parasolid Bodyshop directory.

If this directory is specified, Exchange will use the Parasolid Bodyshop to translate files to Parasolid parts.

Parameters
in_directoryUTF8-encoded directory name.
Returns
A reference to this World object.

◆ SetParasolidSchemaDirectory()

World& HPS::World::SetParasolidSchemaDirectory ( char const *  in_directory)

Sets the schema directory for Parasolid.

This directory must be specified to make use of the Parasolid module.

Note
Using this function will set the P_SCHEMA environment variable to the given directory as well.
Parameters
in_directoryUTF8-encoded directory name.
Returns
A reference to this World object.

◆ SetPublishResourceDirectory()

World& HPS::World::SetPublishResourceDirectory ( char const *  in_directory)

Sets the resource directory for Publish.

This is not the directory which contains the libraries (see World::SetExchangeLibraryDirectory), but rather the directory which contains fonts and associated mappings and files used during PDF generation. This directory must be specified to make use of the Publish module.

Parameters
in_directoryUTF8-encoded directory name.
Returns
A reference to this World object.

◆ SetRealDWGDirectory() [1/2]

World& HPS::World::SetRealDWGDirectory ( char const *  in_directory)

Sets the RealDWG directory.

This directory must be specified to make use of the DWG module.

Parameters
in_directoryUTF8-encoded directory name.
Returns
A reference to this World object.
Deprecated:
This function exists for compatibility. In order to use DWG please make sure that the RealDWG directory is part of your PATH. Users who use RealDWG Object Enablers should additionally make sure that the DBX files for the Object Enablers are located in your PATH, prior to initializing HPS.

◆ SetRealDWGDirectory() [2/2]

World& HPS::World::SetRealDWGDirectory ( char const *  in_directory,
UTF8Array const &  in_object_enabler_directories 
)

Sets the RealDWG directory and its related Object Enabler directories.

This RealDWG directory must be specified to make use of the DWG module.

Parameters
in_directoryUTF8-encoded directory name.
in_object_enabler_directoriesA list of UTF8-encoded directory names.
Returns
A reference to this World object.
Deprecated:
This function exists for compatibility. In order to use DWG please make sure that the RealDWG directory is part of your PATH. Users who use RealDWG Object Enablers should additionally make sure that the DBX files for the Object Enablers are located in your PATH, prior to initializing HPS.

◆ ShowDriverConfigFile()

bool HPS::World::ShowDriverConfigFile ( UTF8 out_filename) const

Shows the driver configuration file for Visualize.

Parameters
out_filenameUTF8-encoded file names.
Returns
true if font directories were specified, false otherwise.

◆ ShowExchangeLibraryDirectory()

bool HPS::World::ShowExchangeLibraryDirectory ( UTF8 out_directory) const

Shows the Exchange and Publish library directory.

Parameters
out_directoryUTF8-encoded directory name.
Returns
true if an Exchange and Publish directory was specified, false otherwise.

◆ ShowFontDirectories()

bool HPS::World::ShowFontDirectories ( UTF8Array out_directories) const

Shows the font directories for Visualize.

Parameters
out_directoriesArray of UTF8-encoded directory names.
Returns
true if font directories were specified, false otherwise.

◆ ShowMaterialLibraryDirectory()

bool HPS::World::ShowMaterialLibraryDirectory ( UTF8 out_directory) const

Shows the material library directory for Visualize.

Parameters
out_directoryUTF8-encoded directory name.
Returns
true if a material library directory was specified, false otherwise.

◆ ShowParasolidBodyshopDirectory()

bool HPS::World::ShowParasolidBodyshopDirectory ( UTF8 out_directory) const

Shows the Parasolid Bodyshop directory.

Parameters
out_directoryUTF8-encoded directory name.
Returns
true if a Parasolid Bodyshop directory was specified, false otherwise.

◆ ShowParasolidSchemaDirectory()

bool HPS::World::ShowParasolidSchemaDirectory ( UTF8 out_directory) const

Shows the Parasolid schema directory.

Parameters
out_directoryUTF8-encoded directory name.
Returns
true if a Parasolid schema directory was specified, false otherwise.

◆ ShowPublishResourceDirectory()

bool HPS::World::ShowPublishResourceDirectory ( UTF8 out_directory) const

Shows the Publish resource directory.

Parameters
out_directoryUTF8-encoded directory name.
Returns
true if a Publish resource directory was specified, false otherwise.

◆ ShowRealDWGDirectory()

bool HPS::World::ShowRealDWGDirectory ( UTF8 out_directory,
UTF8Array out_object_enabler_directories 
) const

Shows the RealDWG directory and any related Object Enabler directories.

Parameters
out_directoryUTF8-encoded directory name.
out_object_enabler_directoriesA list of UTF8-encoded directory names.
Returns
true if a RealDWG directory was specified, false otherwise.
Deprecated:
This function exists for compatibility.

◆ StopCodeGeneration()

static void HPS::World::StopCodeGeneration ( )
static

Stops Code Generation.

◆ Type()

◆ UnsetDriverConfigFile()

World& HPS::World::UnsetDriverConfigFile ( )

Removes the driver configuration file for Visualize.

Returns
A reference to this World object.

◆ UnsetExchangeLibraryDirectory()

World& HPS::World::UnsetExchangeLibraryDirectory ( )

Removes the Exchange and Publish library directory.

Note, this will remove the previously specified directory from the PATH.

Returns
A reference to this World object.

◆ UnsetFontDirectories()

World& HPS::World::UnsetFontDirectories ( )

Removes the font directories for Visualize.

Returns
A reference to this World object.

◆ UnsetMaterialLibraryDirectory()

World& HPS::World::UnsetMaterialLibraryDirectory ( )

Removes the material library directory for Visualize.

Returns
A reference to this World object.

◆ UnsetParasolidBodyshopDirectory()

World& HPS::World::UnsetParasolidBodyshopDirectory ( )

Removes the Parasolid Bodyshop directory.

Returns
A reference to this World object.

◆ UnsetParasolidSchemaDirectory()

World& HPS::World::UnsetParasolidSchemaDirectory ( )

Removes the Parasolid schema directory.

Returns
A reference to this World object.

◆ UnsetPublishResourceDirectory()

World& HPS::World::UnsetPublishResourceDirectory ( )

Removes the Publish resource directory.

Returns
A reference to this World object.

◆ UnsetRealDWGDirectory()

World& HPS::World::UnsetRealDWGDirectory ( )

Removes the RealDWG directory and any Object Enabler directories.

Returns
A reference to this World object.
Deprecated:
This function exists for compatibility.

Member Data Documentation

◆ staticType

const HPS::Type HPS::World::staticType = HPS::Type::World
static

The documentation for this class was generated from the following file: