Home

Part Management


Classes

class  acis_pm_entity_mgr
 Concrete entity manager class for using the ACIS Part Management component in conjunction with ACIS Assembly Modeling. More...
class  acis_pm_entity_mgr_factory
 Concrete entity manager factory class for creating acis_pm_entity_mgr objects. More...
class  active_part
 Declares a class to monitor the active part. More...
class  entity_callback
 Provides notification of changes to entities. More...
class  entity_callback_list
 Provides a type-safe interface to the toolkit_callback_list class and the execute command. More...
class  ID_ATTRIB
 Allows identification of entities in a table. More...
class  PART
 Provides methods and data for grouping entities together as parts. More...
class  roll_callback
 Notifies the user about the start and the end of a roll operation. More...
class  roll_callback_list
 Provides a type-safe interface to the toolkit_callback_list and the execute method. More...
class  UNITS_SCALE
 Defines the UNITS_SCALE class. More...

Defines

#define PART_DO_NOT_DELETE   0x00000001L
 

Typedefs

typedef unsigned long entity_id_t
 Identifier for an ENTITY.

Enumerations

enum  entity_event_type
 These are the types of notifications that entity callback functions receive. More...
enum  roll_event_type
 The type of notification of a callback for a roll operation. More...

Functions

 active_part::active_part ()
 C++ constructor, creating an active_part.
PARTapi_get_active_part ()
 Gets the active part.
outcome api_initialize_part_manager ()
 Initializes the part manager library.
outcome api_part_add_entity (ENTITY *entity, PART *part)
 Adds an ENTITY to a PART.
outcome api_part_create (unsigned int size, PART *&part)
 Creates a new PART.
outcome api_part_delete (PART *part)
 Deletes a PART.
outcome api_part_delete_all_states (HISTORY_STREAM *hs=NULL)
 Deletes all states.
outcome api_part_entities (PART *part, entity_filter *filter, ENTITY_LIST &list)
 Gets a list of entities in a PART.
outcome api_part_entity_id (ENTITY *entity, entity_id_t &id, PART *&part)
 Gets the entity ID and part for an ENTITY.
outcome api_part_get_distribution_mode (logical &distribute)
 Gets history distribution mode which is either TRUE or FALSE.
outcome api_part_load (FILE *fp, logical text_mode, PART *the_part, logical with_history, ENTITY_LIST &new_entities)
 Loads a file into a PART.
outcome api_part_lookup_entity (entity_id_t id, PART *part, ENTITY *&entity)
 Gets an entity given an ID and a PART.
outcome api_part_name_state (const char *name, HISTORY_STREAM *hs=NULL)
 Names the current state.
outcome api_part_note_state (outcome status, int &depth)
 Marks the end of a state.
outcome api_part_remove_entity (ENTITY *entity)
 Removes an ENTITY from a part.
outcome api_part_roll_n_states (int n_wanted, HISTORY_STREAM *hs, int &n_actual)
 Rolls forward or backward a specified number of states.
outcome api_part_roll_to_state (const char *name, HISTORY_STREAM *hs, int &n_actual)
 Rolls to the start of a named state.
outcome api_part_save (FILE *fp, logical text_mode, PART *the_part, logical with_history=0, logical mainline_only=0)
 Saves a PART to a file.
outcome api_part_set_distribution_mode (logical distribute)
 Sets history distribution on or off.
outcome api_part_start_state (int &depth)
 Marks the start of a state.
void api_set_active_part (PART *this_part)
 Sets the part active.
outcome api_terminate_part_manager ()
 Terminates the part manager library.
int count_parts ()
 Counts and returns the number of parts.
 entity_callback_list::entity_callback_list ()
 C++ constructor, creating an entity_callback_list.
ID_ATTRIBfind_ID_ATTRIB (ENTITY *ent)
 Finds the ID attribute for an entity.
PARTfind_part (unsigned int id)
 Finds a PART given the PART's ID but not its handle.
entity_callback_listget_entity_callback_list ()
 Gets a global list of entity callbacks.
PARTget_next_part (int &index)
 Gets the next PART with an ID that is greater than or equal to the next_id.
PARTget_part (const ENTITY *entity)
 Gets the PART for the specified ENTITY.
roll_callback_listget_roll_callback_list ()
 Gets a list of roll callbacks.
logical is_UNITS_SCALE (const ENTITY *ent)
 Determines if the entity is an UNITS_SCALE.
logical same_part (const ENTITY *ent1, const ENTITY *ent2)
 Check that two entities are in the same part.

Define Documentation

#define PART_DO_NOT_DELETE   0x00000001L


Typedef Documentation

typedef unsigned long entity_id_t

Identifier for an ENTITY.


Role: Unique non-persistent identifier for a given ENTITY.

include <entityid.hxx>


Enumeration Type Documentation

These are the types of notifications that entity callback functions receive.

Parameters:
pm_Create_Entity Notification that an entity has been created.
pm_Delete_Entity Notification that an entity has been deleted.
pm_Roll_Create_Entity Notification that the creation of an entity has been un-done.
pm_Roll_Delete_Entity Notification that the deletion of an entity has been un-done.
pm_Roll_Update_Entity Notification that the modification of an entity has been has been undone.
pm_Part_Delete_Delete_Entity Notification that the entity has been modified by deletion of its containing part.
pm_Update_Entity Notification that an entity has been modified.
pm_Remove_Entity Notification that an entity has been removed from a part.
See also:
entity_callback.

include <ent_cb.hxx>

The type of notification of a callback for a roll operation.

Parameters:
Before_Roll We are about to do a roll operation.
After_Roll We are done with a roll operation.

include <roll_cb.hxx>


Function Documentation

active_part::active_part (  )  [inline, inherited]

C++ constructor, creating an active_part.

PART* api_get_active_part (  ) 

Gets the active part.



Effect: Read-only

Journal: Not Available

include <part_api.hxx>

outcome api_initialize_part_manager (  ) 

Initializes the part manager library.



Effect: System routine

Journal: Not Available

Product(s): 3D ACIS Exchange, 3D Viz Exchange, 3D ACIS Modeler

include <part_api.hxx>

outcome api_part_add_entity ( ENTITY entity,
PART part 
)

Adds an ENTITY to a PART.



Role: This API adds a specified entity to a specified part. If the entity is already in a different PART, it is first removed from the old part. All api_part functions should be thought of as requiring the use of the PART class.

Limitation: it is not possible to move an entity into a part if part distribution is enabled and the entity being moved is on a different history stream than the history stream associated with the part. An attempt to do this will result in an error.

Effect: Changes model

Journal: Not Available

Product(s): 3D ACIS Exchange, 3D Viz Exchange, 3D ACIS Modeler

Parameters:
entity entity to be added.
part part to which to add entity.

include <part_api.hxx>

outcome api_part_create ( unsigned int  size,
PART *&  part 
)

Creates a new PART.



Role: This API creates a new part. It initially allocates enough space to contain the specified size (the number of entities). All api_part functions should be thought of as requiring the use of the PART class.

Effect: Changes model

Journal: Not Available

Product(s): 3D ACIS Exchange, 3D Viz Exchange, 3D ACIS Modeler

Parameters:
size initial size of entity table for part.
part returns part.

include <part_api.hxx>

outcome api_part_delete ( PART part  ) 

Deletes a PART.



Role: This API deletes the specified part. All api_part functions should be thought of as requiring the use of the PART class.

Effect: Changes model

Journal: Not Available

Product(s): 3D ACIS Exchange, 3D Viz Exchange, 3D ACIS Modeler

Parameters:
part part.

include <part_api.hxx>

outcome api_part_delete_all_states ( HISTORY_STREAM hs = NULL  ) 

Deletes all states.



Role: This API deletes all operations defined using api_part_start_state and api_part_note_state for the given history stream. Use this API when clearing a part in preparation for loading or creating a new part. All api_part functions should be thought of as requiring the use of the PART class.

Effect: Changes model

Journal: Not Available

Product(s): 3D ACIS Exchange, 3D Viz Exchange, 3D ACIS Modeler

Parameters:
hs history stream to delete.

include <part_api.hxx>

outcome api_part_entities ( PART part,
entity_filter filter,
ENTITY_LIST list 
)

Gets a list of entities in a PART.



Role: This API returns the list of entities fount in a part that match the specified filter. If filter is NULL, this API returns all entities in the part. All api_part functions should be thought of as requiring the use of the PART class.

Effect: Read-only

Journal: Not Available

Product(s): 3D ACIS Exchange, 3D Viz Exchange, 3D ACIS Modeler

Parameters:
part part from which to get entities.
filter filter used to select entities or NULL.
list returns list of entities found.

include <part_api.hxx>

outcome api_part_entity_id ( ENTITY entity,
entity_id_t id,
PART *&  part 
)

Gets the entity ID and part for an ENTITY.



Role: This API returns the entity ID (id) and the part containing the specified entity. If the entity is not in the part, this API returns the entity ID (id) as 0 and the part as NULL. All api_part functions should be thought of as requiring the use of the PART class.

Effect: Read-only

Journal: Not Available

Product(s): 3D ACIS Exchange, 3D Viz Exchange, 3D ACIS Modeler

Parameters:
entity entity to identify.
id entity to identify.
part part containing the entity.

include <part_api.hxx>

outcome api_part_get_distribution_mode ( logical &  distribute  ) 

Gets history distribution mode which is either TRUE or FALSE.



Role: API gets the distribution mode for history streams. If set to TRUE, bulletins are distributed to the appropriate part's stream during note state.

Effect: System routine

Journal: Not Available

Product(s): 3D ACIS Exchange, 3D Viz Exchange, 3D ACIS Modeler

Parameters:
distribute TRUE if history is distributed to part stream after or during note state

include <part_api.hxx>

outcome api_part_load ( FILE *  fp,
logical  text_mode,
PART the_part,
logical  with_history,
ENTITY_LIST new_entities 
)

Loads a file into a PART.



Role: This API loads the entities defined in an open file fp into the specified part. The file must be open and positioned to the start of the entity data to be read. All api_part functions should be thought of as requiring the use of the PART class.

Effect: Changes model

Journal: Not Available

Product(s): 3D ACIS Exchange, 3D Viz Exchange, 3D ACIS Modeler

Parameters:
fp file containing entities to load.
text_mode TRUE (text) or FALSE (binary).
the_part part in which to load entities.
with_history TRUE to restore history if it exists in the file.
new_entities returns list of entities loaded into part.

include <part_api.hxx>

outcome api_part_lookup_entity ( entity_id_t  id,
PART part,
ENTITY *&  entity 
)

Gets an entity given an ID and a PART.



Role: This API looks up an entity in a part given an entity id. If id does not exist in the part, this API returns NULL. All api_part functions should be thought of as requiring the use of the PART class.

Effect: Read-only

Journal: Not Available

Product(s): 3D ACIS Exchange, 3D Viz Exchange, 3D ACIS Modeler

Parameters:
id entity ID.
part part in which to look for entity.
entity found entity.

include <part_api.hxx>

outcome api_part_name_state ( const char *  name,
HISTORY_STREAM hs = NULL 
)

Names the current state.



Role: This API assigns a name to the recent operation. Call api_part_name_state immediately after api_part_note_state and before opening the next state with to api_part_start_state. api_part_name_state names the most recent noted state. api_part_name_state can also be called immediately following starting the modeler if it were desired that the "root" state be named. Use the specified name in calls to api_part_roll_to_state to roll to the start of the current operation. All api_part functions should be thought of as requiring the use of the PART class.

Effect: System routine

Journal: Not Available

Product(s): 3D ACIS Exchange, 3D Viz Exchange, 3D ACIS Modeler

Parameters:
name name to give to current operation.
hs the history stream to use, if not the default.

include <part_api.hxx>

outcome api_part_note_state ( outcome  status,
int &  depth 
)

Marks the end of a state.



Role: This API marks the end of an operation. Match calls to api_part_note_state with earlier calls to api_part_start_state. Pairs can be nested to create larger operations. A new delta state is created for the outermost call only. All api_part functions should be thought of as requiring the use of the PART class.

The calls to api_part_start_state and api_part_note_state must be strictly paired regardless of errors. Start state and note state are paired by the use of a static level counter. If the note state were skipped when there was an error,the counter would be off by one and subsequent states would not be noted.

 int depth;
 api_part_start_state(depth);
 API_BEGIN

 result = api_do_stuff_1(args);
 check_outcome(result);  // If result is not ok,
       // jump to API_END

 // Alternate style of using check_outcome
 check_outcome(api_do_stuff_2(args));

 // Tell the part manager and graphics what happened
 record_entity(new top level entity);
 update_entity(modified top level entity);

 API_END
 api_part_note_state(outcome(API_SUCCESS), depth);
If an error occurs, it will be caught by API_END. The api_part_note_state is always called regardless of error. Note that the outcome is checked before recording or updating entities, so the part manager and graphics don't see anything bad.

It is also acceptable to use API_SYS_BEGIN/END or EXCEPTION_BEGIN/TRY/CATCH/END with api_part_start_state in the EXCEPTION_BEGIN block and api_part_note_state in an EXCEPTION_CATCH( TRUE ) block.

Effect: Read-only

Journal: Not Available

Product(s): 3D ACIS Exchange, 3D Viz Exchange, 3D ACIS Modeler

Parameters:
status outcome of operation.
depth depth of operation nesting after call.

include <part_api.hxx>

outcome api_part_remove_entity ( ENTITY entity  ) 

Removes an ENTITY from a part.



Role: This API removes an ENTITY from a part. All api_part functions should be thought of as requiring the use of the PART class.

Effect: Changes model

Journal: Not Available

Product(s): 3D ACIS Exchange, 3D Viz Exchange, 3D ACIS Modeler

Parameters:
entity entity to be removed.

include <part_api.hxx>

outcome api_part_roll_n_states ( int  n_wanted,
HISTORY_STREAM hs,
int &  n_actual 
)

Rolls forward or backward a specified number of states.



Role: This API rolls a specified number (n_wanted) of states. A negative number rolls to an earlier state; a positive number rolls to a later state. All api_part functions should be thought of as requiring the use of the PART class.

Effect: Changes model

Journal: Not Available

Product(s): 3D ACIS Exchange, 3D Viz Exchange, 3D ACIS Modeler

Parameters:
n_wanted number of states to roll.
hs history stream to roll.
n_actual returns actual number of states rolled.

include <part_api.hxx>

outcome api_part_roll_to_state ( const char *  name,
HISTORY_STREAM hs,
int &  n_actual 
)

Rolls to the start of a named state.



Role: This API rolls to the start of a named operation (name). If multiple operations have the same name, the latest one before the current state is used. If no operations with the given name occur before the current state,the first one after the current state is used. All api_part functions should be thought of as requiring the use of the PART class.

Effect: Changes model

Journal: Not Available

Product(s): 3D ACIS Exchange, 3D Viz Exchange, 3D ACIS Modeler

Parameters:
name name of state to which to roll.
hs history stream.
n_actual number of states actually rolled.

include <part_api.hxx>

outcome api_part_save ( FILE *  fp,
logical  text_mode,
PART the_part,
logical  with_history = 0,
logical  mainline_only = 0 
)

Saves a PART to a file.



Role: This API saves the entities contained in a PART to an open file (fp). The file must be open and positioned to the location to which the entities are to be written.

If the optional with_history is specified as TRUE, roll back history data will be saved as well. If the optional mainline_only flag is specified as TRUE, only un-rolled states will be saved to the file. All api_part functions should be thought of as requiring the use of the PART class.

Effect: Changes model

Journal: Not Available

Product(s): 3D ACIS Exchange, 3D Viz Exchange, 3D ACIS Modeler

Parameters:
fp file in which to save entities.
text_mode TRUE (text) or FALSE (binary).
the_part PART containing entities to save.
with_history TRUE to save history stream to the file.
mainline_only TRUE to ignore rolled states.

include <part_api.hxx>

outcome api_part_set_distribution_mode ( logical  distribute  ) 

Sets history distribution on or off.



Role: This API sets the distribution mode for history streams. If set to TRUE, bulletins are distributed to the appropriate part's stream during note state.

The distribution mode can only be changed once. Further, once bulletins for a part history are created, the distribution mode cannot be changed. By default, distribution is FALSE.

If your application did not explicitly set the option distributed_history to FALSE (i.e., you either left it at its default value, which was TRUE, or explicitly set it to TRUE), you must now call api_part_set_distribution_mode to get the same behavior in your application.

Effect: System routine

Journal: Not Available

Product(s): 3D ACIS Exchange, 3D Viz Exchange, 3D ACIS Modeler

Parameters:
distribute TRUE if history is distributed to part stream after or during note state.

include <part_api.hxx>

outcome api_part_start_state ( int &  depth  ) 

Marks the start of a state.



Role: This API marks the start an operation. Match calls to api_part_start_state with later calls to api_part_note_state. Pairs may be nested to create larger operations. A new delta state is started for the outermost call only. All api_part functions should be thought of as requiring the use of the PART class.

The calls to api_part_start_state and api_part_note_state must be strictly paired regardless of errors. Start state and note state are paired by the use of a static level counter. If the note state were skipped when there was an error,the counter would be off by one and subsequent states would not be noted.

 int depth;
 api_part_start_state(depth);
 API_BEGIN
 
result = api_do_stuff_1(args); check_outcome(result); // If result is not ok, // jump to API_END

                       // Alternate style of using check_outcome
 check_outcome(api_do_stuff_2(args));

                      // Tell the part manager and graphics what happened
 record_entity(new top level entity);
 update_entity(modified top level entity);

 API_END
 api_part_note_state(outcome(API_SUCCESS), depth);
If an error occurs, it will be caught by API_END. The api_part_note_state is always called regardless of error. Note that the outcome is checked before recording or updating entities, so the part manager and graphics don't see anything bad.

It is also acceptable to use API_SYS_BEGIN/END or EXCEPTION_BEGIN/TRY/CATCH/END with api_part_start_state in the EXCEPTION_BEGIN block and api_part_note_state in an EXCEPTION_CATCH( TRUE ) block.

Effect: Read-only

Journal: Not Available

Product(s): 3D ACIS Exchange, 3D Viz Exchange, 3D ACIS Modeler

Parameters:
depth depth of nesting of operations after call.

include <part_api.hxx>

void api_set_active_part ( PART this_part  ) 

Sets the part active.



Effect: System routine

Journal: Not Available

Parameters:
this_part selected part.

include <part_api.hxx>

outcome api_terminate_part_manager (  ) 

Terminates the part manager library.



Effect: System routine

Journal: Not Available

Product(s): 3D ACIS Exchange, 3D Viz Exchange, 3D ACIS Modeler

include <part_api.hxx>

int count_parts (  ) 

Counts and returns the number of parts.



The next_id also increments.

Effect: Read-only

include <part.hxx>

entity_callback_list::entity_callback_list (  )  [inline, inherited]

C++ constructor, creating an entity_callback_list.

ID_ATTRIB* find_ID_ATTRIB ( ENTITY ent  ) 

Finds the ID attribute for an entity.



Effect: Read-only

Parameters:
ent entity.

include <id_attr.hxx>

PART* find_part ( unsigned int  id  ) 

Finds a PART given the PART's ID but not its handle.



Role: Looks up a PART given the PART's ID but not its handle. If the user knows the PART's handle, use the Part method of part_handle to get the PART instead of this procedure because it is faster and more reliable.

Effect: Read-only

Parameters:
id part id.

include <part.hxx>

entity_callback_list& get_entity_callback_list (  ) 

Gets a global list of entity callbacks.



Effect: Read-only

include <ent_cb.hxx>

PART* get_next_part ( int &  index  ) 

Gets the next PART with an ID that is greater than or equal to the next_id.



Effect: Read-only

Parameters:
index part ID.

include <part.hxx>

PART* get_part ( const ENTITY entity  ) 

Gets the PART for the specified ENTITY.



Effect: Read-only

Parameters:
entity entity.

include <part.hxx>

roll_callback_list& get_roll_callback_list (  ) 

Gets a list of roll callbacks.



Use this method to add a new callback to the list.

Effect: Read-only

include <roll_cb.hxx>

logical is_UNITS_SCALE ( const ENTITY ent  ) 

Determines if the entity is an UNITS_SCALE.



Effect: Read-only

Parameters:
ent entity to test.

include <units.hxx>

logical same_part ( const ENTITY ent1,
const ENTITY ent2 
)

Check that two entities are in the same part.



Role: With multiple histories this check is required before operations that merge entities together to avoid intermixing the histories. When the check fails, the caller can either abort with an error or copy one of the entities into the part of the other.

Parameters:
ent1 first entity.
ent2 second entity.

include <part.hxx>