HP_Init

HP_Close

HP_Get_Instances_To_Bodies

HP_Read_Xmt_File

HP_Write_Xmt_File

HP_Delete_Entity_Geometry

HP_Render_Entities

HP_Render_Entity

HP_Set_Instances_To_Bodies

HP_Set_Rendering_Options

HP_Set_Tessellation_Options

HP_Show_Rendering_Options

HP_Show_Tessellation_Options

HP_Compute_Geometry_Keys

HP_Compute_Geometry_Key_Count

HP_Compute_TagID

HP_Associate_Key_To_Entity

HOOPS/Parasolid Error Tokens


HP_Init

Purpose

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.

Calling Sequence

HP_Init (pathToSchemaFiles, useBulletinBoard, bUnicodeFilenames ), returns void.

pathToSchemaFiles

const char *

Path to the directory where schema files are located.

useBulletinBoard

PK_LOGICAL_t

Whether to enable automatic updates.

bUnicodeFilenames

bool

Enables/disables unicode keys for frustrum and filenames. The default value is true.

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.


HP_Close

Purpose

Shuts down the Parasolid kernel. 

Calling Sequence

HP_Close ( void ), returns void


HP_Get_Instances_To_Bodies

Purpose

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

Calling Sequence

HP_Get_Instances_To_Bodies (), returns bool.

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.



HP_Read_Xmt_File

Purpose

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. 

Calling Sequence

HP_Read_Xmt_File (filename, file_partition, num_parts, parts, options), returns error.

 

filename

const char *

Name of the Parasolid File to be parsed.

file_partition

PK_PARTITION_t 

Partition to load parts into.

num_parts

int *

Pointer to number of parts loaded.

parts

PK_PART_t**

Pointer to array of parts loaded.

options

PK_PART_receive_o_t *

Pointer to receive options structure.

error

PK_ERROR_code_t

Error code (zero if OK).

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. To learn more about reading Xmt files, please see the C# Developer's Guide section on Parasolid.


HP_Write_Xmt_File

Purpose

Write a collection of Parasolid entities to a file. 

Calling Sequence

HP_Write_Xmt_File (filename, n_parts, parts, options), returns error.

filename

const char *

Name of file to save to.

parts

PK_PART_t *

Array of parts to save.

n_parts

int

Number of parts to save.

options

PK_PART_transmit_o_t *

Pointer to transmit options structure.

error

PK_ERROR_code_t

Parasolid error code.

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.


HP_Delete_Entity_Geometry

Purpose

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.

Calling Sequence

HP_Delete_Entity_Geometry (count, entities), returns void.

 

count

unsigned long

number of Parasolid entities in the entities array.

entities

PK_ENTITY_t *

Array of Parasolid entity tagIDs.

PreserveSegments

bool

true = delete geometry only, preserve segment structure

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_Entitiesto 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. To learn more about writing Xmt files, please see the C# Developer's Guide section on Parasolid.


HP_Render_Entities

Purpose

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.

Calling Sequence

HP_Render_Entities (count, entities,transf), returns void.

 

count

unsigned long

number of Parasolid entities in the entities array

entities

PK_ENTITY_t *

Array of Parasolid entities

transf

PK_TRANSF_t

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


 

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).


HP_Render_Entity

Purpose

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

Calling Sequence

HP_Render_Entity (entity,transf), returns void.

 

entity

PK_ENTITY_t

Parasolid entity

transf

PK_TRANSF_t

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


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).



HP_Set_Instances_To_Bodies

Purpose

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

Calling Sequence

HP_Set_Instances_To_Bodies (flatten_assembly), returns void.

 

flatten_assembly

bool

indicates whether or not assemblies contained within an XT file are to be flattened


Details

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. The default setting is false.



HP_Set_Rendering_Options

Purpose

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

Calling Sequence

HP_Set_Rendering_Options (list) returns void

 

list

string

A quoted string or a string variable containing a list of the desired settings.

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))");



HP_Set_Tessellation_Options

Purpose

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

Calling Sequence

HP_Set_Tessellation_Options (line_options, go_options, generation_settings), returns void

 

line_options

PK_TOPOL_render_line_o_t *

Parasolid options structure.

go_options

PK_TOPOL_render_facet_go_o_t *

Parasolid options structure.

generation_settings

PK_TOPOL_facet_mesh_o_t *

Parasolid options structure.

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.


HP_Show_Rendering_Options

Purpose

Shows the attribute values previously stored with HP_Set_Rendering_Options

Calling Sequence

HP_Show_Rendering_Options (options), returns void.

 

options

character string

a string which the function will write the current rendering options into


Details

This routine allows developers to query what the current rendering option settings are.




HP_Show_Tessellation_Options

Purpose

Shows the attribute values previously stored with HP_Set_Tessellation_Options

Calling Sequence

HP_Show_Tessellation_Options (line_options, go_options, generation_settings), returns void

 

line_options

PK_TOPOL_render_line_o_t *

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

go_options

PK_TOPOL_render_facet_go_o_t *

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

generation_settings

PK_TOPOL_facet_mesh_o_t *

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

Details

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


HP_Compute_Geometry_Keys

Purpose

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

Calling Sequence

HP_Compute_Geometry_Keys (tagID, max_count, keys, list), returns count;

 

tagID

PK_ENTITY_t

The Tag ID for the Parasolid entity provided for conversion.

max_count

long

Maximum number of keys that should be returned.

list

string

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

keys

HC_KEY *

Array of associated HOOPS keys. Returned to user.

count

long

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

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.


HP_Compute_Geometry_Key_Count

Purpose

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. 

Calling Sequence

HP_Compute_Geometry_Key_Count (tagID, list), returns count

 

tagID

PK_ENTITY_t

The Tag ID for the Parasolid entity provided for computation.

list

string

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

count

count

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

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 number of HOOPS geometric primitives representing the PK_Edge entities in the given Parasolid entity.

faces

Calculate the number of HOOPS geometric primitives representing the PK_Face entities in the given Parasolid entity.

bodies

Calculate the number of HOOPS geometric primitives 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.


HP_Compute_TagID

Purpose

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

Calling Sequence

HP_Compute_TagID (key, paraClass), returns TagID

 

key

HC_Key

HOOPS key provided for computing associated Parasolid entity TagID.

paraClass

PK_Class_t

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

TagID

PK_ENTITY_t

The requested Parasolid tagID. Returned to user. 

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.


HP_Associate_Key_To_Entity

Purpose

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

Calling Sequence

HP_Associate_Key_To_Entity (TagID,key ), returns success

 

key

HC_Key

HOOPS key  that needs to be associated to the Parasolid entity

TagID

PK_ENTITY_t

Parasolid entity that should be associated to the HOOPS key

success

bool

Success of Operation. Returned to user. 

Details

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


HOOPS/Parasolid Error Tokens


The following is a list of the HOOPS/Parasolid error tokens and their meanings: 

HP_ERROR_key_out_of_range: 

HP_ERROR_non_circle_key_out_of_range: 

These errors are obsolete, as the HOOPS-Parasolid integration no longer renumbers HOOPS keys.  You should not see these error codes.

HP_ERROR_key_does_not_exist:

No HOOPS geometry exists for the given key.

HP_ERROR_unable_to_determine_entity_class:

The key provided does not map to an existing Parasolid entity.  You have probably performed a Parasolid operation that deleted this entity, without first calling HP_Delete_Entity_Geometry.

HP_ERROR_non_mappable_entity_class:

There is no clear mapping from the given HOOPS key to the requested Parasolid entity class. 

For example, if you pass the key to a HOOPS elliptical arc and ask for PK_FACE, you will get this error code returned.  It makes more sense to ask for a PK_EDGE when passing a key to a HOOPS elliptical arc.

HP_ERROR_unknown_entity_class:

This error would likely indicate an internal error.  Contact technical support.

HP_ERROR_not_implemented:

This error would likely indicate an internal error, or possibly a case where there is no clear mapping from the given HOOPS key to a single entity of the requested class.  Contact technical support.

HP_ERROR_hoops_key_maps_to_invalid_entity_class:

This error would indicate an internal error.  Contact technical support.

HP_ERROR_incorrect_face_tag_mapping:

This error would indicate an internal error.  Contact technical support.