11 #ifndef __DOP_Parent_h__
12 #define __DOP_Parent_h__
23 template <
typename T>
class UT_Array;
41 {
return myDopParentUniqueId; }
43 void setNeedsToResimulateLastTimestep();
44 void setNeedsToFilterData();
64 bool getNeedsResimulation()
const;
68 const SIM_Time &getOffsetTime()
const;
72 const SIM_Time &getLiveSimulationTime()
const;
73 void setLiveSimulationTime(
const SIM_Time &
t);
74 exint getLastLiveTick()
const;
75 void setLastLiveTick(
exint tick);
76 fpreal getTimeScale()
const;
78 bool getAutoResimulation()
const;
79 void setAutoResimulation(
bool autoreset);
80 bool getInterpolateData(
const SIM_Time &
t)
const;
81 void setInterpolateData(
bool interpolate);
82 bool getIsSimulating()
const;
88 { mySimulating =
val; }
93 {
return myDisableSimulation; }
95 { myDisableSimulation = disable; }
101 void findAllObjectsFromString(
const char *objspec,
108 const SIM_Object *findObjectFromString(
const char *objspec,
109 int whichmatch,
int *nummatch,
115 void findAllRelationshipsFromString(
125 int whichmatch,
int *nummatch,
130 DOP_Node::DOP_CookData &getDopNodeCookData();
137 void sendResimulateNotification(
139 bool changingguideparm);
142 {
return getNonConstEngineSubclass().simMicroNode(); }
144 {
return getNonConstEngineSubclass().simInputMicroNode(); }
146 {
return getNonConstEngineSubclass().resimParmsMicroNode(); }
148 {
return getEngineSubclass().resimParmsMicroNode(); }
150 {
return getNonConstEngineSubclass().refilterParmsMicroNode(); }
152 {
return getEngineSubclass().refilterParmsMicroNode(); }
163 bool callnotify,
bool changingguideparm)
override
164 { sendResimulateNotification(callnotify, changingguideparm); }
182 static OP_Node *getMostRecentWriteableDopOwner();
185 {
return getNeedsResimulation(); }
196 void updateResimParms(
const SIM_Time &
t);
199 const SIM_Time &getLastSetTime()
const;
200 void resimulateLastTimestep();
203 void setNeedsToFilterData(
const SIM_Time &
t);
205 void filterDataIfRequired()
const;
210 virtual const DOP_Engine &getEngineSubclass()
const = 0;
211 virtual void resimulateLastTimestepSubclass();
212 virtual void setDOPTimeSubclass(
const SIM_Time &
t);
213 virtual DOP_Engine &getNonConstEngineSubclass() = 0;
214 virtual void filterDataSubclass(
const SIM_Time &
t) = 0;
219 void notifySimulationChangeSinksOfChange();
220 void notifySimulationChangeSinksOfDelete();
224 DOP_Node::DOP_CookData myDopNodeCookData;
227 bool myLiveSimulation;
229 exint myLastLiveTick;
234 bool myNeedsToFilterData;
236 bool myNeedsToResimulateFrame;
237 bool myNeedsToResimulateCompletely;
238 bool myAutoResimulation;
239 bool myInterpolateData;
240 bool mySendingResimulateNotification;
241 bool myDisableSimulation;
242 int myDopParentUniqueId;
254 { removeAllSimulationChangeSinks(); }
256 virtual void simulationChanged(
DOP_Parent *dopparent) = 0;
258 { removeSimulationChangeSink(dopparent); }
263 if( !dopparent )
return;
264 dopparent->mySimulationChangeSinks.
append(
this, 1);
265 myDopParents.append(dopparent, 1);
269 if( !dopparent )
return;
271 myDopParents.findAndRemove(dopparent);
275 for(
int i = myDopParents.entries(); i --> 0; )
276 removeSimulationChangeSink(myDopParents(i));
bool getDisableSimulation() const
int dopparentUniqueId() const
void addSimulationChangeSink(DOP_Parent *dopparent)
virtual void simulationDeleted(DOP_Parent *dopparent)
static OP_Node * opGetMostRecentDopOwner()
virtual void setNeedsToCompletelyReset()=0
DOP_SimulationChangeSink()
exint findAndRemove(const S &s)
virtual bool opGetDisableSimulation() const =0
void removeAllSimulationChangeSinks()
void removeSimulationChangeSink(DOP_Parent *dopparent)
DEP_MicroNode & resimParmsMicroNode()
virtual void handleRefilterParms(const SIM_Time &t)
void setIsSimulating(bool val)
void setDisableSimulation(bool disable)
GA_API const UT_StringHolder scale
const DEP_MicroNode & refilterParmsMicroNode() const
exint opContinuousCookTick() const override
Current continuous cook tick.
virtual ~DOP_SimulationChangeSink()
virtual void handleResimParms(const SIM_Time &t)
virtual void opGetDiskCache(UT_Array< int > &frames) const =0
DEP_MicroNode & simMicroNode()
void resetPlayer()
Rebuilds the player cache.
bool opIsContinuousCook() const override
Returns if the operator is in Continous Cook mode.
const SIM_Time & getLatestCacheTime() const
Holds pointers to a number of const SIM_Object objects.
void opResetPlayer() override
void opSendResimulateNotification(bool callnotify, bool changingguideparm) override
static OP_Node * getMostRecentDopOwner()
OP_Node * opGetOwner() const override
OP_Node * getOwner() const
virtual void opGetMemoryCache(UT_Array< int > &frames) const =0
virtual bool getIsTimeless() const
virtual bool opIsSimFrameCached(exint simframe) const =0
Note this is in simulation frames, not global.
DEP_MicroNode & refilterParmsMicroNode()
void opResimulate() override
bool opGetNeedsResimulation() const override
DEP_MicroNode & simInputMicroNode()
fpreal opGetLatestCacheTime() const override
virtual void opGetSimExtraInputNodes(OP_NodeList &extras) const =0
const DEP_MicroNode & resimParmsMicroNode() const
virtual void addExtraSimDependencies(DEP_MicroNode *depnode)