Functions

bool HP_Associate_Key_To_Entity(PK_ENTITY_t entity, HC_KEY key)
bool HP_Associate_Key_To_Entity(PK_ENTITY_t entity, HC_KEY key)

This routine will map the provided HOOPS Key to the Parasolid entity.

Details

The Parasolid entity must exist and there must be no existing mapping to this key for this function to succeed.

Parameters

key: HOOPS key that needs to be associated to the Parasolid entity.

TagID: Parasolid entity that should be associated to the HOOPS key.

success: Success of operation. Returned to user.

int HP_CheckConsistency(void)
int HP_CheckConsistency(void)
int HP_Check_Consistency(void)
int HP_Check_Consistency(void)
void HP_Close(void)
void HP_Close(void)

Shuts down the Parasolid kernel.

long HP_Compute_Geometry_Key_Count(PK_ENTITY_t tagID, char *list)
long HP_Compute_Geometry_Key_Count(PK_ENTITY_t tagID, char list)

Given a Parasolid tag ID for any entity, this routine will return the number of HOOPS geometric primitives in the HOOPS database that graphically represent the Parasolid entity. This allows you to create structures of the appropriate size for your subsequent HP_Compute_Geometry_Keys call.

Details

Given a Parasolid tag ID for any entity, this routine will compute the number of HOOPS keys that exist for the geometry in the HOOPS database that represents this Parasolid entity.

Parasolid body entities have, among others, both face and edge entities. The list specifies which of these entities, or both, should be considered when converting the Parasolid TagID. The list is of the form “specification, specification,…”, where each specification can be either “type=value” or “no type”.

The following choices are recognized for type:

  • vertices | Calculate the keys of the HOOPS geometric primitives representing the PK_Vertex entities in the given Parasolid entity.
  • edges | Calculate the keys of the HOOPS geometric primitives representing the PK_Edge entities in the given Parasolid entity.
  • faces | Calculate the keys of the HOOPS geometric primitives representing the PK_Face entities in the given Parasolid entity.
  • bodies | Calculate the keys of the HOOPS geometric primitives representing the PK_Body entities in the given Parasolid entity.

Parameters

tagID: The Tag ID for the Parasolid entity provided for computation.

list: A quoted string or string variable specifying the particular types of Parasolid geometry that should be converted.

count: Number of HOOPS keys associated with the given Parasolid entity. Returned to user.

long HP_Compute_Geometry_Keys(PK_ENTITY_t tagID, long max_count, HC_KEY *keys, char const *list)
long HP_Compute_Geometry_Keys(PK_ENTITY_t tagID, long max_count, HC_KEY keys, char const list)

Given a Parasolid tag ID, this routine will return all the HOOPS keys for the tessellated HOOPS geometric primitives associated with the Parasolid entity.

Details

Given a Parasolid tag ID for any entity, this routine will fill the given array with HOOPS keys for the geometry in the HOOPS database representing that entity. The value returned will be the total number of keys put into the keys array. This number will never be greater than the max_count parameter passed in, which specifies the maximum number of keys desired. The returned value may be less than max_count if the number of HOOPS keys corresponding to the given tagID is less than max_count. The call HP_Compute_Geometry_Key_Count can be used to determine the size of the keys array that will be returned.

Parasolid body entities have, among others, both face and edge entities. The list specifies which of these entities, or both, should be considered when converting the Parasolid tagID. The list is of the form “specification, specification,…”, where each specification can be either “type=value” or “no type”.

The following choices are recognized for type:

  • vertices | Calculate the keys of the HOOPS geometric primitives representing the PK_Vertex entities in the given Parasolid entity.
  • edges | Calculate the keys of the HOOPS geometric primitives representing the PK_Edge entities in the given Parasolid entity.
  • faces | Calculate the keys of the HOOPS geometric primitives representing the PK_Face entities in the given Parasolid entity.
  • bodies | Calculate the keys of the HOOPS segments representing the PK_Body entities in the given Parasolid entity.

A negative return value for count indicates an error. For an explanation of the possible error tokens, please see HOOPS/Parasolid Error Tokens.

Parameters

tagID: The Tag ID for the Parasolid entity provided for conversion.

max_count: Maximum number of keys that should be returned.

list: A quoted string or string variable specifying the particular types of Parasolid geometry that should be converted.

keys: Array of associated HOOPS keys. Returned to user.

count: Actual number of keys returned to user in keys array. Always less than or equal to max_count. Returned to user.

void HP_Compute_Selected_Entity_List(PK_ENTITY_t **entities, int *numentities)
void HP_Compute_Selected_Entity_List(PK_ENTITY_t entities, int numentities)
PK_ENTITY_t HP_Compute_TagID(HC_KEY key, PK_CLASS_t paraClass)
PK_ENTITY_t HP_Compute_TagID(HC_KEY key, PK_CLASS_t paraClass)

Given a HOOPS Key this routine will return the Parasolid Tag ID for the Parasolid entity that contains the specified HOOPS geometric entity.

Details

There is always one and only one Parasolid entity returned by this function. The returned TagID will be of the type chosen by the caller via the “paraClass” parameter. For instance, given a HOOPS key for an edge or face in a HOOPS shell, you may request the tagID of the corresponding PK_Vertex, PK_Edge, PK_Face, or PK_Body.

If no tagID can be found which corresponds to the given HOOPS key, a negative error token is returned. For an explanation of the possible error tokens, please see HOOPS/Parasolid Error Tokens.

Parameters

key: HOOPS key provided for computing associated Parasolid entity TagID.

paraClass: Parasolid Class for desired entity associated with the input HOOPS key.

TagID: The requested Parasolid tagID. Returned to user.

void HP_Delete_Entity_Geometry(unsigned long count, PK_ENTITY_t *entities, bool PreserveSegments = false)
void HP_Delete_Entity_Geometry(unsigned long count, PK_ENTITY_t entities, bool PreserveSegments)

This routine will delete the geometric primitives associated with the given ACIS entities from the HOOPS database and update the mapping between the ACIS pointers and the HOOPS keys.

Details

This function must be called prior to making any Parasolid calls which could modify the topology of a given entity, if it has been previously rendered. Once the Parasolid calls that modify (or delete) the given entity have been completed, the user may choose to call HP_Render_Entities to display the result. This function need not be called if automatic updates are enabled (see HP_Init).

For C# Developers, this function is not available. Instead, we recommend that you use the native C# methods provided by Parasolid.

Parameters

count: Number of Parasolid entities in the entities array.

entities: Array of Parasolid entity tagIDs.

PreserveSegments: true means delete geometry only, preserve segment structure

unsigned char HP_Get_Hash_Level(void)
unsigned char HP_Get_Hash_Level(void)
bool HP_Get_Instances_To_Bodies(void)
bool HP_Get_Instances_To_Bodies(void)

Allows the developer to determine what the modeller will do when it encounters assemblies within a file.

Details

This routine allows developers to see what the current behaviour of the bridge is when it encounters an assembly. If true then the bridge flattens the assembly by turning all instances into bodies with an appropriately applied transform. If false then instances will be honored and created as included objects within the segment hierarchy.

wchar_t const *HP_Get_Schema_Path(void)
wchar_t const HP_Get_Schema_Path(void)
void HP_Init(char const *pathToSchemaFiles, PK_LOGICAL_t useBulletinBoard, bool bUnicodeFilenames = true)
void HP_Init(char const pathToSchemaFiles, PK_LOGICAL_t useBulletinBoard, bool bUnicodeFilenames)

Initializes the Parasolid kernel, registers the HOOPS specific implementation of the Parasolid GO_Routines, initializes HOOPS and its connection to the application’s user interface.

This is a required call. Call HP_Init prior to any other HP or PK function. You must pass a valid string as the path to the schema files if you wish to read or write XMT files of any version other than the version of Parasolid to which your application is linked.

The useBulletinBoard argument will in general be PK_false. However, if you wish to try out a new, undocumented feature of the integration, you may pass PK_true as the useBulletinBoard argument. In this case, HP_Render_Entity and HP_Delete_Entity_Geometry should never be called; instead, after each Parasolid operation, a single call to HP_Update(void) will populate (and de-populate) the HOOPS database with the appropriate geometry by analyzing the Parasolid bulletin board. Contact support@techsoft3d.com if you require information or assistance with using this feature, which should be considered as being in a beta stage of development.

Parameters

pathToSchemaFiles: Path to the directory where schema files are located.

useBulletinBoard: Whether to enable automatic updates.

bUnicodeFilenames: Enables or disables Unicode keys for frustum and filenames. The default value is true.

void HP_Init(wchar_t const *pathToSchemaFiles, PK_LOGICAL_t useBulletinBoard, bool bUnicodeFilenames = true)
void HP_Init(wchar_t const pathToSchemaFiles, PK_LOGICAL_t useBulletinBoard, bool bUnicodeFilenames)

Initializes the Parasolid kernel, registers the HOOPS specific implementation of the Parasolid GO_Routines, initializes HOOPS and its connection to the application’s user interface.

Details

This is a required call. Call HP_Init prior to any other HP or PK function. You must pass a valid string as the path to the schema files if you wish to read or write XMT files of any version other than the version of Parasolid to which your application is linked.

The useBulletinBoard argument will in general be PK_false. However, if you wish to try out a new, undocumented feature of the integration, you may pass PK_true as the useBulletinBoard argument. In this case, HP_Render_Entity and HP_Delete_Entity_Geometry should never be called; instead, after each Parasolid operation, a single call to HP_Update(void) will populate (and de-populate) the HOOPS database with the appropriate geometry by analyzing the Parasolid bulletin board. Contact support@techsoft3d.com if you require information or assistance with using this feature, which should be considered as being in a beta stage of development.

Parameters

pathToSchemaFiles: Path to the directory where schema files are located.

useBulletinBoard: Whether to enable automatic updates.

bUnicodeFilenames: Enables or disables Unicode keys for frustum and filenames. The default value is true.

PK_ERROR_code_t HP_Read_Xmt_File(char const *filename, PK_PARTITION_t file_partition, int *num_parts, PK_PART_t **parts, PK_PART_receive_o_t const *options, bool tesselate = true, char const *face_tessellation_level = nullptr)
PK_ERROR_code_t HP_Read_Xmt_File(char const filename, PK_PARTITION_t file_partition, int num_parts, PK_PART_t parts, PK_PART_receive_o_t const options, bool tesselate, char const face_tessellation_level)
PK_ERROR_code_t HP_Read_Xmt_File(wchar_t const *filename, PK_PARTITION_t file_partition, int *num_parts, PK_PART_t **parts, PK_PART_receive_o_t const *options, bool tesselate = true)
PK_ERROR_code_t HP_Read_Xmt_File(wchar_t const filename, PK_PARTITION_t file_partition, int num_parts, PK_PART_t parts, PK_PART_receive_o_t const options, bool tesselate)

Parses the specified Parasolid file and populates the modeling kernel with its contents, then maps the model to a corresponding HOOPS segment tree hierarchy including geometry and attributes.

Details

Loads parts from given filename into given partition. If given partition is a null partition, then a new partition is created. Arguments “parts” and “num_parts,” if non NULL, are mutated to provide an array of parts loaded to the caller. If parts is non NULL, then an array will be allocated within the HP_Read_Xmt_File function. If parts is non NULL, then num_parts must also be non NULL.

When the caller is finished with this array, the caller should use PK_MEMORY_free(*parts) to free the allocated memory. Num_parts indicates the number of parts in the array.

If the file contains assemblies, then these assemblies, and any instances within them, are expanded into PK_BODY entities. Instanced entities are copied to become full-fledged PK_BODY entities. The returned array of PK_PART entities will not contain any assemblies.

If NULL is passed as the value for options, then default values will be used for transmitting the file, except that the default format will be the text format.

See the Parasolid documentation of the PK_PART_receive function for further details; HP_Read_Xmt_File is function is similar to this Parasolid call.

For C# Developers, this function is not available. Instead, we recommend that you use the native C# methods provided by Parasolid.

Parameters

filename: Name of the Parasolid File to be parsed.

file_partition: Partition to load parts into.

num_parts: Pointer to number of parts loaded.

parts: Pointer to array of parts loaded.

options: Pointer to receive options structure.

tesselate: Defaults to true

Returns

Parasolid error code
void HP_Render_Entities(unsigned long count, PK_ENTITY_t *entities, PK_TRANSF_t view_transf = NULTAG, PK_TRANSF_t *topol_transf = 0, char const *face_tessellation_level = nullptr)
void HP_Render_Entities(unsigned long count, PK_ENTITY_t entities, PK_TRANSF_t view_transf, PK_TRANSF_t topol_transf, char const face_tessellation_level)

This call will generate the tessellation of a set of Parasolid entities and store the primitives in the HOOPS database using the HOOPS/Parasolid Bridge.

Details

This routine encapsulates and replaces the Parasolid PK_TOPOL_render_xxx routines for users of the HOOPS/Parasolid Bridge. Call this function to populate the HOOPS graphical database. This function need not be called if automatic updates are enabled (see HP_Init).

Parameters

count: Number of Parasolid entities in the entities array

entities: Array of Parasolid entities

transf: Transformation matrix ID for view dependent tesselation (default is 0)

face_tessellation_level: Facet tessellation level (default is custom). Allowed values are lowest, low, medium, high, highest, custom.

void HP_Render_Entity(PK_ENTITY_t entity, PK_TRANSF_t trans = NULTAG, PK_TRANSF_t topol_transf = NULTAG, char const *face_tessellation_level = nullptr)
void HP_Render_Entity(PK_ENTITY_t entity, PK_TRANSF_t trans, PK_TRANSF_t topol_transf, char const face_tessellation_level)

This call will generate the tessellation of a Parasolid entity and store it in the HOOPS database using the HOOPS/Parasolid Bridge.

Details

This routine encapsulates and replaces the Parasolid PK_TOPOL_render_xxx routines for users of the HOOPS/Parasolid Bridge. Call this function to populate the HOOPS graphical database. This function need not be called if automatic updates are enabled (see HP_Init).

Parameters

entity: Parasolid entity

transf: Transformation matrix ID for view dependent tesselation (default is 0)

void HP_Set_Hash_Level(unsigned char level)
void HP_Set_Hash_Level(unsigned char level)
void HP_Set_Instances_To_Bodies(bool flatten)
void HP_Set_Instances_To_Bodies(bool flatten)

Allows developer to tell the bridge to honor the assembly definition that may be contained within a XT file.

Details

If the parameter is true then the bridge flattens the assembly by turning all instances into bodies with an appropriately applied transform. If false then instances will be honored and created as included objects within the segment hierarchy. The default setting is false.

Parameters

flatten_assembly: Indicates whether or not assemblies contained within an XT file are to be flattened
void HP_Set_Rendering_Options(char const *list)
void HP_Set_Rendering_Options(char const list)

Provides control over the manner in which Parasolid models are mapped to the HOOPS Segment Tree by the HOOPS/Parasolid GO_Routines implementation.

Details

The following choices are recognized:

[no] create body segments [= on, off]

Controls how each Parasolid Body entity is mapped to the HOOPS segment tree. When you specify “create body segments = on”, a HOOPS segment is created for each Parasolid body. These HOOPS segments are created as sub segments of the currently open segment. This is useful when you wish to apply unique HOOPS display/rendering attributes to a group of geometric primitives representing a Parasolid Body, or expect to apply additional transformations to individual Parasolid Bodies. When you specify “create body segments = off”, no extra HOOPS segments are created for individual bodies when they are rendered. The default is “create body segments”. [no] merge faces [= on, off]

Controls how the Parasolid face entities are mapped to HOOPS shell primitives. When you specify “merge faces”, when each subsequent PK_BODY is finished being rendered, the HOOPS shells that have been generated (one for each face) will be merged together into a single shell. In the case of a multi-colored PK_BODY, the shells corresponding to PK_FACES that have the same color attribute will be merged into one HOOPS shell, resulting in as many HOOPS shells are there are distinct colors in the PK_BODY entity. This mapping results in optimal rendering speed at the expense of ease of manipulating individual PK_FACE entities. Applications that are concerned only with viewing, or that do not need to select at the PK_FACE level (to perform ‘face level’ Parasolid operations) may gain rendering speed advantages by making use of this feature. When you specify “no merge faces”, one HOOPS shell remains for each PK_FACE rendered. This mode is required if your application must interact with individual PK_FACEs. The default is “no merge faces”. [no] preserve color [= on, off]

Controls whether the Parasolid rendered geometry will be partitioned into separate HOOPS segments based on color attributes. This will result in correct rendering of the geometry while maximizing performance by grouping like-colored geometry into the same segment. When you specify “preserve color = on” , then a HOOPS segment is created for each unique color in the Parasolid geometry being rendered. These HOOPS segments are created as sub segments of the currently open segment. When specified in conjunction with “create body segments = on”, the segment that is currently open at the time the color segments are created will be the segment that is unique to the PK_BODY being rendered. Otherwise, the currently open segment will be whatever HOOPS segment the user has opened at the time that the PK_TOPOL_render_facet or PK_TOPOL_render_line is called. Within each created HOOPS segment, the color attributes of the segment will be set (for lines and faces) to the appropriate values. When you specify “preserve color = off”, then color attributes in the Parasolid geometry are ignored when HOOPS geometry is created. The default is “preserve color”. In addition to segments created for each unique color attribute set in the Parasolid geometry being rendered, one additional segment will be created if there is any Parasolid geometry that does not have any color attribute set on it. This segment, like the colored segments, will be created as a child segment of the currently open segment and a sibling segment of any colored segments if any exist. No color attributes will be set in this segment. Parasolid PK_EDGEs in general do not have color attributes attached to them. If an edge itself does not have a color attribute attached, then these edges are treated as if they have the color attribute of their owning face. However, an edge may have more than one owning face (usually an edge will have two owning faces), and each of the owning faces may have a different color attribute. In this unusual case, the color of the PK_EDGE is undefined, and may be assigned a color of any one of its owning faces. If you wish for PK_EDGEs to ignore color attributes, but you do want faces to be colored by their color attributes, then you can set a global color attribute for line color and specify an “attribute lock” on line color, which will override the line color attributes set in the created color segments (in the HOOPS world, Parasolid PK_EDGEs will correspond to HOOPS line entities, not HOOPS edge entities). As an example of how to do this, you could, in the same segment that is open when you call PK_TOPOL_render_xxxx, call the following two functions: HC_Set_Color(“lines = white”); HC_Set_Rendering_Options(“attribute lock = (color = (lines))”);

Parameters

list: A quoted string or a string variable containing a list of the desired settings.
void HP_Set_Schema_Path(char const *schema_path)
void HP_Set_Schema_Path(char const schema_path)
void HP_Set_Tessellation_Options(PK_TOPOL_render_line_o_t *line_Options, PK_TOPOL_render_facet_go_o_t *go_options, PK_TOPOL_facet_mesh_o_t *generation_settings)
void HP_Set_Tessellation_Options(PK_TOPOL_render_line_o_t line_Options, PK_TOPOL_render_facet_go_o_t go_options, PK_TOPOL_facet_mesh_o_t generation_settings)

Provides control over how the Parasolid PK_Render routine maps geometry to the HOOPS database via the HOOPS/Parasolid GO_Routines.

Details

The line_options, go_options, and generation_settings parameters are Parasolid option structures and are passed directly to the appropriate PK_Render_XXX routine. For details on what the Parasolid option structures are, please refer to the Parasolid Reference manual. These options are used during all HP_Render_Entity, HP_Read_Xmt_file, and HP_Update operations.

Parameters

line_options: Parasolid options structure.

go_options: Parasolid options structure.

generation_settings: Parasolid options structure.

void HP_Show_One_Rendering_Option(char const *type, char *value)
void HP_Show_One_Rendering_Option(char const type, char value)
void HP_Show_Rendering_Options(char *list)
void HP_Show_Rendering_Options(char list)

This routine allows developers to query what the current rendering option settings are as previously stored with HP_Set_Rendering_Options.

Parameters

options: A string which the function will write the current rendering options into
void HP_Show_Tessellation_Options(PK_TOPOL_render_line_o_t *line_Options, PK_TOPOL_render_facet_go_o_t *go_options, PK_TOPOL_facet_mesh_o_t *generation_settings)
void HP_Show_Tessellation_Options(PK_TOPOL_render_line_o_t line_Options, PK_TOPOL_render_facet_go_o_t go_options, PK_TOPOL_facet_mesh_o_t generation_settings)

Shows the attribute values previously stored with HP_Set_Tessellation_Options.

Details

Caller passes pointers to PK_TOPOL_xxx structures. These must be pointers to valid structures, as this function will not allocate memory.

Parameters

line_options: Parasolid options structure. Returned to user. Passed by reference.

go_options: Parasolid options structure. Returned to user. Passed by reference.

generation_settings: Parasolid options structure. Returned to user. Passed by reference.

void HP_Update(void)
void HP_Update(void)
bool HP_Update_Entity(PK_ENTITY_t entity, PK_TRANSF_t view_trans = NULTAG, PK_TRANSF_t topol_transf = NULTAG)
bool HP_Update_Entity(PK_ENTITY_t entity, PK_TRANSF_t view_trans, PK_TRANSF_t topol_transf)

Updates the given entity by re-tessellating it. The HOOPS segment hierarchy will be retained. This API function requires following conditions to succeed

  1. entity to be updated should be of PK_BODY_t class
  2. entity should have already been rendered first by calling HP_Render_Entity API
  3. ‘create body segments’ rendering option should be on

Parameters

entity: The entity to be updated (should be of PK_BODY_t type)

transView: transformation (default is NULTAG)

topol_transf: Entity transformation (default is NULTAG)

Returns

bool true if succeeds
PK_ERROR_code_t HP_Write_Xmt_File(char const *filename, int num_parts, PK_PART_t const *parts, PK_PART_transmit_o_t const *options)
PK_ERROR_code_t HP_Write_Xmt_File(char const filename, int num_parts, PK_PART_t const parts, PK_PART_transmit_o_t const options)
PK_ERROR_code_t HP_Write_Xmt_File(wchar_t const *filename, int num_parts, PK_PART_t const *parts, PK_PART_transmit_o_t const *options)
PK_ERROR_code_t HP_Write_Xmt_File(wchar_t const filename, int num_parts, PK_PART_t const parts, PK_PART_transmit_o_t const options)

Write a collection of Parasolid entities to a file.

Details

Writes parts from a partition into a given filename.

If NULL is passed as the value for options , then default values will be used for transmitting the file, except that the default format will be text format. See the Parasolid documentation of the PK_PART_transmit function for further details; this function is more or less identical to the Parasolid call. It is provided for convenience only - at this point equivalent functionality can be achieved by using the PK_PART_transmit function.

Parameters

Name: of file to save to.

Array: of parts to save.

Number: of parts to save.

Pointer: to transmit options structure.

Returns

Parasolid error code.