3 #include <osg/Referenced>
7 namespace Visualization
11 class OsgScriptedSimulationWindow;
17 ControlPoint(
const double t,
const osg::Vec3d pos,
const osg::Vec3d v)
24 m_Uv(osg::Vec3d(0.0, 0.0, 0.0)),
26 m_lpParentSpline(NULL),
37 m_Uv(osg::Vec3d(0.0, 0.0, 0.0)),
39 m_lpParentSpline(NULL),
52 osg::Vec3d m_ReportPos;
70 virtual osg::Vec3d Position();
71 virtual void Position(CStdFPoint &oPoint,
bool bUseScaling =
true);
72 virtual void Position(
float fltX,
float fltY,
float fltZ,
bool bUseScaling =
true);
73 virtual void Position(std::string strXml,
bool bUseScaling =
true);
75 virtual double Time();
76 virtual void Time(
double dblVal);
78 virtual OsgLinearPath *ParentSpline() {
return m_lpParentSpline;};
79 virtual void ParentSpline(
OsgLinearPath *lpParentSpline) {m_lpParentSpline = lpParentSpline;};
81 virtual bool SetData(
const std::string &strDataType,
const std::string &strValue,
bool bThrowError =
true);
82 virtual void QueryProperties(CStdPtrArray<TypeProperty> &aryProperties);
104 virtual osg::Vec3d Transform(
const osg::Vec3d p) {
return p; }
111 typedef std::vector<osg::ref_ptr<ControlPoint> > PointListType;
124 bool AddControlPoint(
const osg::Vec3d point,
const double time);
130 void ClearAllControlPoints();
133 unsigned int GetNumberOfControlPoints() {
return m_ControlPoints.size(); }
136 ControlPoint* GetControlPoint(
const unsigned int i) {
return m_ControlPoints[i].get(); }
141 virtual osg::Node *CreateTestGeom(
const bool showControlPoints =
false,
142 const unsigned int numSamples = 3,
143 ControlPointTransformFunctor* xform = NULL);
146 virtual bool Interpolate(
const double t);
149 osg::Vec3d &GetInterpPosition() {
return m_Interpolated; }
151 osg::Vec3d GetPositionAtTime(
const double t);
153 virtual CStdColor *LineColor();
154 virtual void LineColor(CStdColor &aryColor);
155 virtual void LineColor(
float *aryColor);
156 virtual void LineColor(std::string strXml);
158 virtual std::string PartID();
159 virtual void PartID(std::string strID);
161 virtual double StartTime();
162 virtual void StartTime(
double dblTime,
bool bSortPaths =
true);
164 virtual double EndTime();
165 virtual void EndTime(
double dblTime,
bool bSortPaths =
true);
167 virtual bool Visible();
168 virtual void Visible(
bool bVal);
170 virtual bool VisibleInSim();
171 virtual void VisibleInSim(
bool bVal);
173 virtual bool ShowWaypoints();
174 virtual void ShowWaypoints(
bool bVal);
176 virtual BodyPart *TrackBody() {
return m_lpTrackBody;};
178 virtual void SimStarting();
179 virtual void ResetSimulation();
181 virtual bool SetData(
const std::string &strDataType,
const std::string &strValue,
bool bThrowError =
true);
182 virtual void QueryProperties(CStdPtrArray<TypeProperty> &aryProperties);
183 virtual bool AddItem(
const std::string &strItemType,
const std::string &strXml,
bool bThrowError =
true,
bool bDoNotInit =
false);
184 virtual bool RemoveItem(
const std::string &strItemType,
const std::string &strID,
bool bThrowError =
true);
185 virtual void Initialize();
188 virtual void RedrawCurve();
190 virtual bool BeforePathTime(
double dblTime);
191 virtual bool WithinPathTime(
double dblTime);
192 virtual bool AfterPathTime(
double dblTime);
194 virtual OsgScriptedSimulationWindow *ParentWindow() {
return m_lpParentWindow;};
195 virtual void ParentWindow(OsgScriptedSimulationWindow *lpWnd) {m_lpParentWindow = lpWnd;};
200 void InvalidateCurve();
207 void FindCurrentWaypoint(
const double t);
209 osg::ref_ptr<ControlPoint> LoadWaypoint(CStdXml &oXml);
211 virtual void AddWaypoint(std::string strXml);
212 virtual void RemoveWaypoint(std::string strID,
bool bThrowError =
true);
213 virtual int FindWaypointPos(std::string strID,
bool bThrowError =
true);
214 virtual void MakeVisible(
bool bVal);
222 PointListType m_ControlPoints;
225 osg::Vec3d m_Interpolated;
228 std::string m_strPartID;
231 BodyPart *m_lpTrackBody;
234 double m_dblStartTime;
240 CStdColor m_vLineColor;
246 bool m_bVisibleInSim;
249 bool m_bShowWaypoints;
252 osg::ref_ptr<osg::Node> m_osgSpline;
254 OsgScriptedSimulationWindow *m_lpParentWindow;
257 ControlPoint *m_lpCurrentWaypoint;
260 int m_iCurrentWaypointIdx;
Classes for implementing the cm-labs vortex physics engine for AnimatLab.
A standard xml manipulation class.