dart
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
MyWindow Class Reference

class MyWindow More...

#include <MyWindow.hpp>

Inheritance diagram for MyWindow:
Inheritance graph
[legend]
Collaboration diagram for MyWindow:
Collaboration graph
[legend]

Public Member Functions

void drawWorld () const override
 
void keyboard (unsigned char _key, int _x, int _y) override
 
void spawnCube (const Eigen::Vector3d &_position=Eigen::Vector3d(0.0, 1.0, 0.0), const Eigen::Vector3d &_size=Eigen::Vector3d(0.1, 0.1, 0.1), double _mass=0.1)
 
 MyWindow (Controller *_controller)
 Constructor.
 
virtual ~MyWindow ()
 Destructor.
 
void timeStepping () override
 
void drawSkels () override
 
void keyboard (unsigned char _key, int _x, int _y) override
 
void timeStepping () override
 
void drawWorld () const override
 
void keyboard (unsigned char _key, int _x, int _y) override
 
void setController (Controller *_controller)
 
 MyWindow (dart::dynamics::SkeletonPtr _skel)
 The constructor - set the position of the skeleton.
 
void draw () override
 Draw the skeleton.
 
void keyboard (unsigned char _key, int _x, int _y) override
 Move the joints with the {1,2,3} keys and '-' to change direction.
 
 MyWindow (const WorldPtr &world)
 
void keyboard (unsigned char key, int x, int y) override
 
void drawWorld () const override
 
void timeStepping () override
 
void timeStepping () override
 
void drawWorld () const override
 
void keyboard (unsigned char _key, int _x, int _y) override
 
void timeStepping () override
 
void drawSkels () override
 
void keyboard (unsigned char key, int x, int y) override
 
void setController (Controller *_controller)
 
void timeStepping () override
 
void keyboard (unsigned char key, int x, int y) override
 
void drawWorld () const override
 
 MyWindow (Controller *_controller)
 Default constructor.
 
virtual ~MyWindow ()
 Destructor.
 
void timeStepping () override
 
void drawWorld () const override
 
void keyboard (unsigned char _key, int _x, int _y) override
 
void timeStepping () override
 
void timeStepping () override
 
void drawWorld () const override
 
void keyboard (unsigned char _key, int _x, int _y) override
 
void timeStepping () override
 
 MyWindow ()
 Constructor.
 
virtual ~MyWindow ()
 Destructor.
 
void timeStepping () override
 
void keyboard (unsigned char key, int x, int y) override
 
void drawWorld () const override
 
void spawnBox (const Eigen::Isometry3d &_T, const Eigen::Vector3d &_size=Eigen::Vector3d(0.1, 0.1, 0.1), double _mass=10)
 Spawn a box into the world.
 
void spawnEllipsoid (const Eigen::Isometry3d &_T, const Eigen::Vector3d &_radii=Eigen::Vector3d(0.1, 0.1, 0.1), double _mass=10)
 Spawn a ellipsoid into the world.
 
void spawnCylinder (const Eigen::Isometry3d &_T, double _radius=0.05, double _height=0.10, double _mass=10)
 Spawn a cylinder into the world.
 
void timeStepping () override
 
void keyboard (unsigned char key, int x, int y) override
 
void drawWorld () const override
 
void timeStepping () override
 
void drawWorld () const override
 
void keyboard (unsigned char _key, int _x, int _y) override
 
 MyWindow (const WorldPtr &world)
 Constructor.
 
void keyboard (unsigned char key, int x, int y) override
 Handle keyboard input.
 
void timeStepping () override
 
 MyWindow (const WorldPtr &world)
 Constructor.
 
void keyboard (unsigned char key, int x, int y) override
 Handle keyboard input.
 
void timeStepping () override
 
 MyWindow (const WorldPtr &world, const SkeletonPtr &ball, const SkeletonPtr &softBody, const SkeletonPtr &hybridBody, const SkeletonPtr &rigidChain, const SkeletonPtr &rigidRing)
 
void keyboard (unsigned char key, int x, int y) override
 
void drawWorld () const override
 
void displayTimer (int _val) override
 
 MyWindow (const WorldPtr &world, const SkeletonPtr &ball, const SkeletonPtr &softBody, const SkeletonPtr &hybridBody, const SkeletonPtr &rigidChain, const SkeletonPtr &rigidRing)
 
void keyboard (unsigned char key, int x, int y) override
 
void drawWorld () const override
 
void displayTimer (int _val) override
 
 MyWindow (const WorldPtr &world)
 
void attemptToCreateDomino (double)
 
void deleteLastDomino ()
 
void keyboard (unsigned char key, int x, int y) override
 
void timeStepping () override
 
 MyWindow (const WorldPtr &world)
 
void attemptToCreateDomino (double angle)
 
void deleteLastDomino ()
 
void keyboard (unsigned char key, int x, int y) override
 
void timeStepping () override
 
 MyWindow (WorldPtr world)
 Constructor.
 
void changeDirection ()
 
void applyForce (std::size_t index)
 
void changeRestPosition (double)
 
void changeStiffness (double)
 
void changeDamping (double)
 
void addConstraint ()
 Add a constraint to attach the final link to the world.
 
void removeConstraint ()
 Remove any existing constraint, allowing the pendulum to flail freely.
 
void keyboard (unsigned char key, int x, int y) override
 Handle keyboard input.
 
void timeStepping () override
 
 MyWindow (WorldPtr world)
 Constructor.
 
void changeDirection ()
 
void applyForce (std::size_t index)
 
void changeRestPosition (double delta)
 
void changeStiffness (double delta)
 
void changeDamping (double delta)
 
void addConstraint ()
 Add a constraint to attach the final link to the world.
 
void removeConstraint ()
 Remove any existing constraint, allowing the pendulum to flail freely.
 
void keyboard (unsigned char key, int x, int y) override
 Handle keyboard input.
 
void timeStepping () override
 
- Public Member Functions inherited from dart::gui::glut::SimWindow
virtual void drawSkeletons () const
 
virtual void drawEntities ()
 
void setWorld (dart::simulation::WorldPtr _world)
 
void saveWorld ()
 Save world in 'tempWorld.txt'.
 
void plot (Eigen::VectorXd &_data)
 Plot _data in a 2D window.
 
- Public Member Functions inherited from dart::gui::glut::Win3D
void initWindow (int _w, int _h, const char *_name) override
 
void resize (int _w, int _h) override
 
void render () override
 
void click (int _button, int _state, int _x, int _y) override
 
void drag (int _x, int _y) override
 
virtual void initGL ()
 
virtual void initLights ()
 

Public Attributes

dart::dynamics::SkeletonPtr skel
 Hardcoded skeleton.
 
int ts
 
HumanArmJointLimitConstraintPtr constraint_larm
 
HumanArmJointLimitConstraintPtr constraint_rarm
 
HumanLegJointLimitConstraintPtr constraint_lleg
 
HumanLegJointLimitConstraintPtr constraint_rleg
 

Protected Member Functions

bool addObject (const SkeletonPtr &)
 Add an object to the world and toss it at the wall.
 
void addRing (const SkeletonPtr &ring)
 Add a ring to the world, and create a BallJoint constraint to ensure that it stays in a ring shape.
 
void removeSkeleton (const SkeletonPtr &skel)
 Remove a Skeleton and get rid of the constraint that was associated with it, if one existed.
 
bool addObject (const SkeletonPtr &object)
 Add an object to the world and toss it at the wall.
 
void addRing (const SkeletonPtr &ring)
 Add a ring to the world, and create a BallJoint constraint to ensure that it stays in a ring shape.
 
void removeSkeleton (const SkeletonPtr &skel)
 Remove a Skeleton and get rid of the constraint that was associated with it, if one existed.
 
- Protected Member Functions inherited from dart::gui::glut::SimWindow
virtual void drawSkeleton (const dynamics::Skeleton *skeleton, const Eigen::Vector4d &color=Eigen::Vector4d::Constant(0.5), bool useDefaultColor=true) const
 
virtual void drawEntity (const dynamics::Entity *entity, const Eigen::Vector4d &color=Eigen::Vector4d::Constant(0.5), bool useDefaultColor=true) const
 
virtual void drawBodyNode (const dynamics::BodyNode *bodyNode, const Eigen::Vector4d &color=Eigen::Vector4d::Constant(0.5), bool useDefaultColor=true, bool recursive=false) const
 
virtual void drawShapeFrame (const dynamics::ShapeFrame *shapeFrame, const Eigen::Vector4d &color=Eigen::Vector4d::Constant(0.5), bool useDefaultColor=true) const
 
virtual void drawShape (const dynamics::Shape *shape, const Eigen::Vector4d &color=Eigen::Vector4d::Constant(0.5)) const
 
virtual void drawPointMasses (const std::vector< dynamics::PointMass *> pointMasses, const Eigen::Vector4d &color=Eigen::Vector4d::Constant(0.5), bool useDefaultColor=true) const
 
virtual void drawMarker (const dynamics::Marker *marker, const Eigen::Vector4d &color=Eigen::Vector4d::Constant(0.5), bool useDefaultColor=true) const
 
- Protected Member Functions inherited from dart::gui::glut::Window
virtual void specKey (int _key, int _x, int _y)
 
virtual void move (int _x, int _y)
 
virtual void simTimer (int _val)
 
virtual bool screenshot ()
 

Protected Attributes

std::unique_ptr< ControllermController
 
int mForceCountDown
 Number of iterations before clearing a force entry. More...
 
bool mPositiveSign
 Whether a force should be applied in the positive or negative direction.
 
bool mRandomize
 Flag to keep track of whether or not we are randomizing the tosses.
 
std::random_device mRD
 
std::mt19937 mMT
 
std::uniform_real_distribution< double > mDistribution
 
std::vector< dart::dynamics::JointConstraintPtr > mJointConstraints
 History of the active JointConstraints so that we can properly delete them when a Skeleton gets removed.
 
SkeletonPtr mOriginalBall
 A blueprint Skeleton that we will use to spawn balls.
 
SkeletonPtr mOriginalSoftBody
 A blueprint Skeleton that we will use to spawn soft bodies.
 
SkeletonPtr mOriginalHybridBody
 A blueprint Skeleton that we will use to spawn hybrid bodies.
 
SkeletonPtr mOriginalRigidChain
 A blueprint Skeleton that we will use to spawn rigid chains.
 
SkeletonPtr mOriginalRigidRing
 A blueprint Skeleton that we will use to spawn rigid rings.
 
std::size_t mSkelCount
 Keep track of how many Skeletons we spawn to ensure we can give them all unique names.
 
SkeletonPtr mFirstDomino
 Base domino. Used to clone new dominoes.
 
SkeletonPtr mFloor
 Floor of the scene.
 
std::vector< SkeletonPtr > mDominoes
 History of the dominoes that have been created.
 
std::vector< double > mAngles
 History of the angles that the user has specified.
 
double mTotalAngle
 Sum of all angles so far.
 
bool mHasEverRun
 Set to true the first time spacebar is pressed.
 
int mPushCountDown
 The manipulator will attempt to push on the first domino while the value of this is greater than zero.
 
std::shared_ptr< ArrowShapemArrow
 An arrow shape that we will use to visualize applied forces.
 
SkeletonPtr mPendulum
 The pendulum that we will be perturbing.
 
dart::dynamics::BallJointConstraintmBallConstraint
 Pointer to the ball constraint that we will be turning on and off.
 
std::vector< int > mForceCountDown
 Number of iterations before clearing a force entry.
 
bool mBodyForce
 True if 1-9 should be used to apply a body force. More...
 
dart::dynamics::BallJointConstraintPtr mBallConstraint
 Pointer to the ball constraint that we will be turning on and off.
 
- Protected Attributes inherited from dart::gui::glut::SimWindow
simulation::WorldPtr mWorld
 
int mPlayFrame
 
bool mPlay
 
bool mSimulating
 
bool mShowPointMasses
 If true, render point masses of soft bodies.
 
bool mShowMarkers
 If true, render markers.
 
std::vector< GraphWindow * > mGraphWindows
 Array of graph windows.
 
- Protected Attributes inherited from dart::gui::glut::Win3D
Trackball mTrackBall
 
Eigen::Vector3d mTrans
 
Eigen::Vector3d mEye
 
Eigen::Vector3d mUp
 
float mZoom
 
float mPersp
 
bool mRotate
 
bool mTranslate
 
bool mZooming
 
- Protected Attributes inherited from dart::gui::glut::Window
int mWinWidth
 
int mWinHeight
 
int mMouseX
 
int mMouseY
 
double mDisplayTimeout
 
bool mMouseDown
 
bool mMouseDrag
 
bool mCapture
 
double mBackground [4]
 
gui::RenderInterfacemRI
 
std::vector< unsigned char > mScreenshotTemp
 
std::vector< unsigned char > mScreenshotTemp2
 
- Protected Attributes inherited from dart::gui::glut::SoftSimWindow
bool mShowPointMasses
 
bool mShowMeshs
 

Additional Inherited Members

- Static Public Member Functions inherited from dart::gui::glut::Window
static void reshape (int _w, int _h)
 
static void keyEvent (unsigned char _key, int _x, int _y)
 
static void specKeyEvent (int _key, int _x, int _y)
 
static void mouseClick (int _button, int _state, int _x, int _y)
 
static void mouseDrag (int _x, int _y)
 
static void mouseMove (int _x, int _y)
 
static void refresh ()
 
static void refreshTimer (int _val)
 
static void runTimer (int _val)
 
static Windowcurrent ()
 
- Static Public Attributes inherited from dart::gui::glut::Window
static std::vector< Window * > mWindows
 
static std::vector< int > mWinIDs
 

Detailed Description

class MyWindow

MyWindow.

Member Data Documentation

◆ mBodyForce

bool MyWindow::mBodyForce
protected

True if 1-9 should be used to apply a body force.

Otherwise, 1-9 will be used to apply a joint torque.

◆ mForceCountDown

std::vector< int > MyWindow::mForceCountDown
protected

Number of iterations before clearing a force entry.

The first domino will be pushed by a disembodied force while the value of this is greater than zero.


The documentation for this class was generated from the following files: