#include <SIM_Engine.h>
This is the main engine behind all simulations. Any number of these can be created to create independent simulations. Generally a simulation will be owned by a particular OP_Node. For example, the DopNet object contains a SIM_Engine.
Definition at line 64 of file SIM_Engine.h.
Constructor to create a new simulation.
Destructor to destroy all data associated with a simulation.
Adds an error to the engine. The object and data parameters allow the DOP_Engine to put the error message on an appropriate DOP Node. Errors are found in the SIM error file. This function simply calls addErrorSubclass().
The default implementation of this function does nothing.
Reimplemented in DOP_Engine.
Adds an interest in the supplied node. When the node changes, the engine's handleExternalNodeChange function will be called.
Creates a new relationship. The creationflags parameter accepts the same SIM_DATA_* flags accepted by the creationflags parameter of SIM_Data::createNamedSubData().
Allocates a new SIM_Object and adds it to the simulation. The name parameter is assigned to the object. This name does not have to be unique.
This function is called by our cache whenever the most recent simulated timestep is being removed from memory (either deleted or moved onto disk).
Reimplemented in DOP_Engine.
Clears the selection flag on all data in this simulation.
Creates an object in the current state with a particular time stamp. This function is useful for solvers that need to do their own time stepping with step sizes smaller than the globally specified time step size. These explicitly stored subsamples are accessible later with the getObjectAtTime() function.
Gets all the relationships of a particular type. The type of a relationship is defined by the one subdata on the SIM_Relationship.
Returns a list of objects created by the specified node, or any nodes inside the specified node (if it is a subnet).
Filters all our simulation objects based on a string pattern. Note that the time value is a simulation time, not global time.
Filters all our relationships based on a string pattern. Note that the time value is a simulation time, not global time.
Returns a single object matching a specified string pattern. Note that the time value is a simulation time, not global time.
Returns a single relationship matching a specified string pattern. Note that the time value is a simulation time, not global time.
Returns a non-const pointer to an object for a particular time. This function is very similar to getObjectAtTime() except for two things. First, it requires a non-const starting object, and it is a non-const function. Second, if the specified time exactly matches a time in the past, the returned object will be a copy of that past object, not the object itself. Otherwise modifying that object could modify the past. However, if the current time is sepcified, the actual object (i.e. a pointer to the passed in SIM_Object) is returned. This function is for use by solvers that want to modify their affector objects and which do substepping.
Returns the cached frames. Inclusive.
Returns a reference to the cache options for this simulation.
Gets the id for the node that is currently being processed.
Definition at line 312 of file SIM_Engine.h.
Gets the index of the node output that is currently being processed.
Definition at line 315 of file SIM_Engine.h.
Returns all available data type names. If a null type pointer is passed in, this function returns a list of every data type that the SIM_Engine can create. If a data type name is passed in, the list returned will only contain those data types that can be cast to the specified data type using the SIM_Data::getPointerToType() function.
Returns all available data types and the source of their definition. The definition source will be an empty string if the data type is defined internally to Houdini. Otherwise it will be the name of the DSO or DLL file that contains the data type.
Returns a list of the superclass names for the specified data type.
Returns the descriptive name for a data type. Given the unique identifying name for a data type this function finds the appropriate data factory and returns the descriptive string assigned to the type.
Returns the SIM_DopDescription from the SIM_DataFactory of a particular data type.
Returns the time of the earliest simulation state in the cache.
Returns the simulation time that corresponds to the given global time.
Returns the simulation time that corresponds to the given global time.
Reimplemented in DOP_Engine.
Fetch all the nodes in which this simulation has an interest. This method can get the normal node interests, guide geometry interests, or both.
Gets the current feedback iteration we are on. If we are not currently solving, this function will return -1;
Returns the global time that corresponds to the given simulation time.
Returns the global time that corresponds to the given simulation time.
Reimplemented in DOP_Engine.
Gets the maximum number of allowed feedback iterations.
Unique id that is bumped whenever the simulation is reset or a frame is resimulated.
Definition at line 481 of file SIM_Engine.h.
This function is the only way for a SIM_Engine subclass to get a non-const SIM_Object pointer.
Returns the "nth" simulation object that matches a supplied filter. If less than the supplied n objects match the filter, 0 is returned.
Returns the number of relationships in the current simulation state.
Returns the number of objects currently in the simulation.
Returns the number of objects currently in the simulation.
Returns a pointer to the state of an object at some time in the past. This function searches for these past object states in three ways. First, if the specified time is equal to a past time step, the state for that time step is returned. Second, if the specified time is not equal to a past time step, then past time steps are searched for object states stored explicitly with createSubStepObject(). Finally, if both these methods fail to find a matching object state, then the closest object states before and after the specified time are found using the first two approaches. Then a new object state is created by interpolating between these two states using SIM_Data::interpolate(). This third approach is skipped if allowinterpolation is set to false. If no previous or no future object state can be found, then this function returns null.
This is a more direct, more efficient method for reading cached versions of objects from previous frames, without interpolation.
Before the call, 'past_objects' must be a valid array of SIM_Object* arrays and 'past_times' must be a valid array of SIM_Time. 'past_objects' must have size 'max_past' each element of 'past_objects' must be an array of SIM_Object* of size 'num_objects' 'past_times' must be an array of size 'max_past'
Output: The number of cached frames is returned. The cached version of object[oi] at time past_times[i] is stored in the array past_objects[i] at location oi, for all 0 <= i < "the returned number of cached frames"
Gets the full path to the DOP Network node that owns this simulation.
Returns true if the engine is providing data hierarchy hints.
This function allows looping through the simulations relationships.
Returns the relationship with the specified name.
Returns either a SIM_Relationship or SIM_Object depending on the information stored in the id parameter.
Gets a list of all selected data in the simulation.
Returns the simulation frame number that corresponds to the given time. The simulation frame number is the number of timesteps that need to be run to get to the specified time, plus one (so that time zero is frame 1).
Returns a pointer to the SIM_Object at the specified index. The index value is the current location of the object in the simulations's list of objects. This value will not be the same as the SIM_Object::getObjectId() value.
Returns a pointer to the SIM_Object with the specified unique id. This function searches the current list of objects for the specified objectid. If the objectid is not found, this function returns null.
Returns the current simulation time.
Returns the simulation time that corresponds to the given simulation frame.
Returns the time step size.
Returns the total amount of memory used by all data currently in this simulation, at the current time or in the cache.
Override this method to handle changes to external nodes in which we have an interest. The default implementation does nothing.
Reimplemented in DOP_Engine.
Returns whether there is an explicit interest on the node.
Definition at line 355 of file SIM_Engine.h.
Definition at line 472 of file SIM_Engine.h.
Loads a simulation state from a file and merges it into the current simulation state. The data that gets loaded is not allowed to do any sharing of data with the current state, since the data id's can't be expected to match. Objects from the file will replace objects from the current state if their object ids match. Objects loaded from the file will be flagged so that they will not be solved in the current timestep. In subsequent timesteps these objects will be solved. The filter parameter specifies which objects stored in the file are merged in.
Passes up to our owner to alert anything that needs an OP_Event in response to use becoming dirty.
Reimplemented in DOP_Engine.
Definition at line 360 of file SIM_Engine.h.
Initializes a newly created object. This function is called by addSimulationObject(). The default implementation does nothing.
Reimplemented in DOP_Engine.
Allows special handling of objects that are being removed. This function is called by removeSimulationObject(). The default implementation does nothing.
Reimplemented in DOP_Engine.
This function is run after all objects are processed by their solvers.
Reimplemented in DOP_Engine.
This function is run before passing each object to its solver. The implementation at this level clears out all temporary data from the simulation objects.
Reimplemented in DOP_Engine.
Definition at line 458 of file SIM_Engine.h.
Definition at line 460 of file SIM_Engine.h.
Removes all node interests from the engine.
Removes all relationships created by a particular DOP node. If -1 is specified, then all relationships are removed. Relationships in the "except" array are not removed.
Removes the relationship at the specified position.
Removes the relationship with the specified name.
Removes the specified relationship.
Removes a SIM_Object from the simulation. The index value is the current location of the object in the simulations's list of objects. This value will not be the same as the SIM_Object::getObjectId() value, and may change when objects are added to or removed from the simulation.
Removes a SIM_Object from the simulation. This version of this function takes a SIM_Object pointer instead of an index. The pointer is converted to an index and the indexed version of removeSimulationObject() is called.
Removes an object previously created by createSubStepObject(). If the allwithmatchingid parameter is set to true, not only will the specified object be destroyed, but all other objects with the same object id created using createSubStepObject() will be destroyed. This provides a quick way to destroy all temporary working copies of a particular object.
Resets the errors stored in the simulation.
Reimplemented in DOP_Engine.
Rebuilds the player cache.
Resets the simulation to a clean state. This function calls clearSimulation(), then builds a single empty simulation state.
Reimplemented in DOP_Engine.
Marks this engine as invalid without actually clearing or resetting anything. A proper reset implies also a frame advance to the first frame that can be expensive. Note the cache will not be cleared until it is cooked, however!
Definition at line 277 of file SIM_Engine.h.
Definition at line 454 of file SIM_Engine.h.
Definition at line 456 of file SIM_Engine.h.
Schedules some objects to be saved to a files at the end of the current timestep. The filter parameter makes it possible to save only some of the objects to the file. The actual save happens in the postSimulationStep().
Saves the entire current state of the simulation immediately.
Returns the scale factor to convert a value in MKS units into the equivalent value in the provided units.
Returns the scale factor to convert a value in the provided units into the equivalent MKS value.
Sets the cache options for this simulation.
Set the creator information. These values are automatically reset to (-1, -1) before performing a simulation step.
Sets this simulation as a player. It will replace it's cache with simulation data from the files given and not simulate, just read the files.
Alerts our owner that we are simulating due to an internally generated need. Returns the previous state
Reimplemented in DOP_Engine.
Sets the maximum number of allowed feedback iterations.
Specifies whether the engine should provide data hierarchy hints.
Sets the current time for the simulation. If the new simulation time is less than the current time, the SIM_Cache is simply set to use its best match for the chosen time. If the new simulation time is greater than the current time, the simulation is stepped forward in time to the new time. The resimlasttimestep parameter causes the most recent cache entry to be deleted before trying to set the current time. This is useful if some parameter of the simulation changes on the current timestep. It causes the timestep to be recooked with the new parameter. This resimulation may also happen if the simulation was interrupted the last time this function was called. The forceresetsim parameter tells the SIM_Engine to reset the simulation before trying to move to the specified time, whether the reset is required or not.
Sets the global time step size.
This micronode holds the simulation input. It is wired directly to the simMicroNode, however, does not care about refilter events.
Definition at line 450 of file SIM_Engine.h.
Definition at line 452 of file SIM_Engine.h.
The micronode representing the simulation result. It is marked as dirtied and propagated whenever the simulation is cleared. Callers can use this to express dependencies on/from the simulation.
Definition at line 443 of file SIM_Engine.h.
Definition at line 445 of file SIM_Engine.h.
Tries to expand the cached frame range.
Definition at line 669 of file SIM_Engine.h.
Definition at line 670 of file SIM_Engine.h.
Definition at line 664 of file SIM_Engine.h.
Definition at line 665 of file SIM_Engine.h.
Definition at line 666 of file SIM_Engine.h.
Definition at line 672 of file SIM_Engine.h.
Definition at line 668 of file SIM_Engine.h.
Definition at line 667 of file SIM_Engine.h.
Definition at line 679 of file SIM_Engine.h.
Definition at line 678 of file SIM_Engine.h.
Definition at line 677 of file SIM_Engine.h.
Definition at line 675 of file SIM_Engine.h.
Definition at line 676 of file SIM_Engine.h.