1 #ifndef SimTK_SimTKCOMMON_SUBSYSTEM_GUTS_H_
2 #define SimTK_SimTKCOMMON_SUBSYSTEM_GUTS_H_
36 class DecorativeGeometry;
50 const String& version=
"0.0.0");
53 const String& getName()
const;
54 const String& getVersion()
const;
126 assert(q.
size() == getNQ(s));
130 assert(u.
size() == getNU(s));
134 assert(z.
size() == getNZ(s));
186 int getNQ (
const State&)
const;
188 int getNU (
const State&)
const;
190 int getNZ (
const State&)
const;
192 int getNQErr (
const State&)
const;
194 int getNUErr (
const State&)
const;
196 int getNUDotErr (
const State&)
const;
198 int getNMultipliers(
const State&)
const;
200 getEventTriggerStartByStage(
const State&,
Stage)
const;
201 int getNEventTriggersByStage(
const State&,
Stage)
const;
208 bool isInSystem()
const;
209 bool isInSameSystem(
const Subsystem& otherSubsystem)
const;
211 const System& getSystem()
const;
217 const Subsystem& getOwnerSubsystemHandle()
const;
219 void setOwnerSubsystemHandle(
Subsystem&);
220 bool hasOwnerSubsystemHandle()
const;
225 explicit Guts(GutsRep* r) : rep(r) { }
227 const GutsRep&
getRep()
const {assert(rep);
return *rep;}
228 GutsRep&
updRep()
const {assert(rep);
return *rep;}
229 void setRep(GutsRep& r) {assert(!rep); rep = &r;}
231 bool subsystemTopologyHasBeenRealized()
const;
232 void invalidateSubsystemTopologyCache()
const;
247 void realizeSubsystemTopology (
State&)
const;
248 void realizeSubsystemModel (
State&)
const;
249 void realizeSubsystemInstance (
const State&)
const;
250 void realizeSubsystemTime (
const State&)
const;
251 void realizeSubsystemPosition (
const State&)
const;
252 void realizeSubsystemVelocity (
const State&)
const;
253 void realizeSubsystemDynamics (
const State&)
const;
254 void realizeSubsystemAcceleration(
const State&)
const;
255 void realizeSubsystemReport (
const State&)
const;
262 void calcDecorativeGeometryAndAppend
265 void createScheduledEvent(
const State& state,
EventId& eventId)
const;
266 void createTriggeredEvent(
const State& state,
EventId& eventId,
274 void calcEventTriggerInfo
276 void calcTimeOfNextScheduledEvent
278 bool includeCurrentTime)
const;
279 void calcTimeOfNextScheduledReport
281 bool includeCurrentTime)
const;
318 virtual int calcDecorativeGeometryAndAppendImpl
321 virtual void calcEventTriggerInfoImpl
323 virtual void calcTimeOfNextScheduledEventImpl
325 bool includeCurrentTime)
const {}
326 virtual void calcTimeOfNextScheduledReportImpl
328 bool includeCurrentTime)
const {}
329 virtual void handleEventsImpl
333 virtual void reportEventsImpl
337 void advanceToStage(
const State& s,
Stage g)
const;
343 friend class GutsRep;
348 #endif // SimTK_SimTKCOMMON_SUBSYSTEM_GUTS_H_