Image Component Library (ICL)
Classes | Public Member Functions | Public Attributes | Private Types | Private Attributes | Friends | List of all members
icl::physics::ManipulatablePaper Class Reference

extension of the standard physical paper class More...

#include <ManipulatablePaper.h>

Inheritance diagram for icl::physics::ManipulatablePaper:
icl::physics::PhysicsPaper icl::physics::SoftObject icl::physics::PhysicsObject icl::utils::Configurable icl::geom::SceneObject icl::utils::Uncopyable

Classes

struct  DraggedPositionIndicator
 
struct  LineAnnotation
 Utility class for extra annotations, rendered in paper coordinates. More...
 
struct  Shadow
 
struct  VertexAttractor
 

Public Member Functions

 ManipulatablePaper (PhysicsWorld *world, geom::Scene *scene, int W, int H, const geom::Vec *init, bool initByCorners, const core::Img8u *frontTexture=0, const core::Img8u *backTexture=0)
 create with given parameters More...
 
geom::Vec getPos (const utils::Point &idx)
 get's current position of node at given coorndinats More...
 
void prepareForRendering ()
 updates all cubes from the underlying paper More...
 
void addAttractor (utils::Point coords, bool oscillating=false)
 adds a new attractor at given coordinates More...
 
void removeAttractor (utils::Point coords)
 removes an attractor at given coordinates More...
 
void removeAllAttractors ()
 removes all current attractors More...
 
void applyAllForces (float attractorForce, float mouseForce)
 applies all attractors and optional mouse force More...
 
qt::MouseHandlercreateMouseHandler (int cameraIndex=0)
 creates a mouse handler using the internal scene More...
 
void setCubesVisible (bool on)
 sets whether the handle cubes are visible More...
 
void setTextureVisible (bool on)
 sets texture or shaded mode More...
 
virtual void adaptRowStiffness (float val, int row)
 adation to base class (colors the cubes) More...
 
virtual void adaptColStiffness (float val, int col)
 adation to base class (colors the cubes) More...
 
virtual void adaptGlobalStiffness (float val)
 adation to base class (colors the cubes) More...
 
void removeAllLineAnnoations ()
 removes all line annotations More...
 
void adaptStiffnessAlongLine (const utils::Point32f &a, const utils::Point32f &b, float val)
 adapts all constraints, that intersect the given 2D line (using the current camera) More...
 
void addLineAnnotation (const utils::Point32f &a, const utils::Point32f &b, const geom::GeomColor &color=geom::GeomColor(255, 100, 0, 255))
 adds a line annotation (given in paper coordinats=; More...
 
void removeAllAnnoations ()
 
utils::Point32f getPaperCoordinates (const utils::Point32f &screenPosition2D)
 returns the paper position for a given 2D screen position or (-1,-1) if not found More...
 
void setDraggedPosition (const utils::Point32f &paperPos)
 adds a highlight at given position More...
 
void setShowAllConstraints (bool show)
 sets whether contraints are visualized More...
 
bool getShowAllConstraints () const
 returns whether constraints are shown More...
 
virtual void complexCustomRender (icl::geom::ShaderUtil *u)
 custom rendering for constraint visualization More...
 
virtual void saveCFG (const std::string &filename)
 saves the current constraints More...
 
virtual void loadCFG (const std::string &filename)
 loads current constraints More...
 
void addShadow (float zLevel)
 
utils::Point32f getPaperCoordinates (const geom::ViewRay &ray)
 import name for parent class More...
 
- Public Member Functions inherited from icl::physics::PhysicsPaper
 PhysicsPaper (const PhysicsWorld &scene, int nxCells, int nyCells, const geom::Vec *init, bool initWithCorners, const core::Img8u *texture=0, const core::Img8u *backfaceTexture=0)
 
virtual void updateSceneObject ()
 adapted version of update scene object that does already get the special version of the object More...
 
void moveVertex (const utils::Point &xy, const geom::Vec &pos, float factor)
 moves a vertex More...
 
void movePosition (const utils::Point32f &paperPos, const geom::Vec &pos, float factor)
 moves an arbitrary paper position towards pos More...
 
utils::Point getNodeIndex (const geom::Vec &v)
 
void setDraggedNode (const utils::Point &xy)
 
const utils::SizegetDimensions () const
 
geom::Vec getNodePosition (int x, int y) const
 
geom::Vec getNodePosition (const utils::Point &p) const
 
void setNodeMass (const utils::Point &xy, float mass)
 
void setNodeMass (const geom::Vec &v, float mass)
 
void setTotalMass (float mass)
 
core::Img32f getVelocityMap () const
 
void adaptStiffnessAlongIntersection (const geom::PlaneEquation &plane, float val)
 softens all constraints that intersect the given plane equation More...
 
virtual void memorizeDeformation ()
 
virtual void resetDeformation ()
 
utils::Point32f getPaperCoordinates (const geom::ViewRay &ray)
 finds the optimal paper coordinates for a given point in the world More...
 
geom::Vec getInterpolatedPosition (const utils::Point32f &paperPos)
 returns the world position for a given paper position More...
 
geom::Vec getPosFromPhysics (int x, int y) const
 returns node position (using the physics model, translated to ICL-units) More...
 
geom::Vec getNormalFromPhysics (int x, int y)
 returns node normal (using the physics model, translated to ICL-units) More...
 
- Public Member Functions inherited from icl::physics::SoftObject
 SoftObject (const std::string &objFileName, PhysicsWorld *world)
 constructor that uses an obj-file to create a softbody More...
 
virtual btSoftBody * getSoftBody ()
 returns internal physical object as softBody More...
 
virtual const btSoftBody * getSoftBody () const
 returns internal physical object as softBody (const) More...
 
void propertyChanged (const Configurable::Property &prop)
 this is now linked via register callback More...
 
- Public Member Functions inherited from icl::physics::PhysicsObject
 PhysicsObject ()
 Default constructor (initializint m_physicalObject with 0) More...
 
virtual ~PhysicsObject ()
 Destructor (freeing m_physicalObject if not 0) More...
 
void setPhysicalObject (btCollisionObject *obj)
 sets the physical object (delets the old one of not 0) More...
 
void forgetPhysicalObject (bool removeFromWorld=true)
 sets the internal physical object o null, but wont delete it! More...
 
virtual btCollisionObject * getCollisionObject ()
 returns internal physical object as collision object More...
 
virtual const btCollisionObject * getCollisionObject () const
 
virtual void setTransformation (const geom::Mat &m)
 Sets the transform of this object. Scaling or shearing is not supported: Use setScale instead. More...
 
virtual void transform (const geom::Mat &m)
 applies the given transformation matrix. Scaling or shearing is not supported: Use setScale instead. More...
 
geom::Mat getTransformation ()
 returns the transformation of this object More...
 
void setScale (geom::Vec scale)
 
geom::Vec getScale ()
 
void setCollisionMargin (float margin)
 sets the collision margin for this object More...
 
void setFriction (float friction)
 sets the friction of this object More...
 
void setRollingFriction (float friction)
 sets the rolling friction of this obect More...
 
void setCollisionGroup (int group)
 sets the collision group of this object More...
 
int getCollisionGroup ()
 returns the collision group of this object More...
 
void setContactResponse (bool response)
 enables or disable collision with other objects More...
 
bool hasContactResponse ()
 Checks if the object has a collisionresponse. More...
 
void setRestitution (float restitution)
 sets the restitution of this object More...
 
void activate (bool forceActivation=false)
 sets the activation mode of this object More...
 
int getCollisionObjectType ()
 
void setCollisionObjectType (int type)
 
int getCollisionFlags ()
 
void setCollisionFlags (int flags)
 
void stateChanged ()
 sets an internal flag to update the sceneobject More...
 
void setCurrentPhysicsWorld (PhysicsWorld *world)
 sets an internal pointer to the world the object is currently in More...
 
void setCollisionCallback (utils::Function< void, PhysicsObject *, PhysicsObject *, geom::Vec > collisionCallback)
 sets the collision callback of the object More...
 
void collisionCallback (PhysicsObject *self, PhysicsObject *other, geom::Vec pos)
 calls the collision callback of the object More...
 
void setObjectID (std::string const &id)
 sets the identifier string. There is no proof for beeing unique within the world More...
 
std::string getObjectID ()
 returns the (not unique) object identifier More...
 
std::string getObjectID () const
 returns the (not unique) object identifier (const) More...
 
- Public Member Functions inherited from icl::geom::SceneObject
ICLGeom_API SceneObject ()
 create an object More...
 
ICLGeom_API SceneObject (const std::string &type, const float *params)
 create by string: More...
 
ICLGeom_API SceneObject (const std::string &objFileName)
 creates a scene object from given .obj file More...
 
 SceneObject (const SceneObject &other)
 deep copy of SceneObject instance More...
 
ICLGeom_API SceneObjectoperator= (const SceneObject &other)
 assignment operator for deep copy More...
 
virtual ICLGeom_API ~SceneObject ()
 Empty destructor (but virtual) More...
 
ICLGeom_API std::vector< Vec > & getVertices ()
 returns object vertices More...
 
ICLGeom_API const std::vector< Vec > & getVertices () const
 returns object vertices (const) More...
 
ICLGeom_API const std::vector< Vec > & getNormals () const
 returns object normals (const) More...
 
ICLGeom_API std::vector< GeomColor > & getVertexColors ()
 returns object vertex colors More...
 
ICLGeom_API const std::vector< GeomColor > & getVertexColors () const
 returns object vertex colors (const) More...
 
ICLGeom_API std::vector< Primitive * > & getPrimitives ()
 returns object's primitives (lines, quads, etc...) More...
 
ICLGeom_API const std::vector< Primitive * > & getPrimitives () const
 returns object's primitives (lines, quads, etc...) (const) More...
 
ICLGeom_API void setVisible (int oredTypes, bool visible, bool recursive=true)
 changes visibility of given primitive type More...
 
ICLGeom_API void setVisible (const std::string &what, bool recursive=true)
 convenience method that allows for setting several visibility properties at once More...
 
void setVisible (const char *what, bool recursive=true)
 explicit version for const char pointer to avoid an explicit cast to bool/int More...
 
ICLGeom_API bool isVisible (Primitive::Type t) const
 returns visibility of given primitive type More...
 
virtual ICLGeom_API bool isInvisibleForCamera (int camIndex) const
 this can be overwrittern in subclasses to hide an object for given camera indices More...
 
ICLGeom_API void addVertex (const Vec &p, const GeomColor &color=GeomColor(255, 0, 0, 255))
 adds a new vertex to this object More...
 
ICLGeom_API void addSharedTexture (utils::SmartPtr< qt::GLImg > gli)
 adds a GLImg as shared texture More...
 
ICLGeom_API void addSharedTexture (const core::ImgBase *image, core::scalemode sm=core::interpolateLIN)
 adds an core::ImgBase * as shared texutre More...
 
ICLGeom_API void addNormal (const Vec &n)
 adds a new normal to this object More...
 
ICLGeom_API void addLine (int x, int y, const GeomColor &color=GeomColor(100, 100, 100, 255))
 adds a new line to this object More...
 
ICLGeom_API void addTriangle (int a, int b, int c, int na, int nb, int nc, const GeomColor &color=GeomColor(0, 100, 250, 255))
 adds a new triangle to this onject More...
 
void addTriangle (int a, int b, int c, const GeomColor &color=GeomColor(0, 100, 250, 255))
 convenience method for creation of a triangle with auto-normals More...
 
ICLGeom_API void addQuad (int a, int b, int c, int d, int na, int nb, int nc, int nd, const GeomColor &color=GeomColor(0, 100, 250, 255))
 adds a new triangle to this onject More...
 
void addQuad (int a, int b, int c, int d, const GeomColor &color=GeomColor(0, 100, 250, 255))
 convenience method for creation of a quad with auto-normals More...
 
ICLGeom_API void addPolygon (int nPoints, const int *vertexIndices, const GeomColor &color=GeomColor(0, 100, 250, 255), const int *normalIndices=0)
 add a polygon to this object (note triangles and quads are slower here) More...
 
ICLGeom_API void addTexture (int a, int b, int c, int d, const core::ImgBase *texture, int na, int nb, int nc, int nd, bool createTextureOnce=true, core::scalemode sm=core::interpolateLIN)
 
void addTexture (int a, int b, int c, int d, const core::ImgBase *texture, bool createTextureOnce=true, core::scalemode sm=core::interpolateLIN)
 convenience method for creation of a texture with auto-normals More...
 
ICLGeom_API void addTexture (int a, int b, int c, int d, int sharedTextureIndex, int na=-1, int nb=-1, int nc=-1, int nd=-1)
 adds are shared texture primitive More...
 
ICLGeom_API void addTexture (const core::ImgBase *image, int numPoints, const int *vertexIndices, const utils::Point32f *texCoords, const int *normalIndices=0, bool createTextureOnce=true)
 adds a GenericTexturePrimitive for custom texCoords More...
 
ICLGeom_API void addTextureGrid (int w, int h, const core::ImgBase *image, const icl32f *px, const icl32f *py, const icl32f *pz, const icl32f *pnx=0, const icl32f *pny=0, const icl32f *pnz=0, int stride=1, bool createTextureOnce=true, core::scalemode sm=core::interpolateLIN)
 adds a texture that is drawn on a 2D grid of vertices in 3D space More...
 
ICLGeom_API void addTwoSidedTextureGrid (int w, int h, const core::ImgBase *front, const core::ImgBase *back, const icl32f *px, const icl32f *py, const icl32f *pz, const icl32f *pnx=0, const icl32f *pny=0, const icl32f *pnz=0, int stride=1, bool createFrontOnce=true, bool createBackOnce=true, core::scalemode sm=core::interpolateLIN)
 adds a texture grid that has two different texture for the two faces More...
 
ICLGeom_API void addTwoSidedTGrid (int w, int h, const Vec *vertices, const Vec *normals=0, const GeomColor &frontColor=GeomColor(0, 100, 255, 255), const GeomColor &backColor=GeomColor(255, 0, 100, 255), const GeomColor &lineColor=GeomColor(0, 255, 100, 255), bool drawLines=false, bool drawQuads=true)
 adds a two sided grid (sides may have different colors) More...
 
ICLGeom_API void addTextTexture (int a, int b, int c, int d, const std::string &text, const GeomColor &color, int na, int nb, int nc, int nd, int textSize, core::scalemode sm=core::interpolateLIN)
 adds text-texture quad -primitive to this object More...
 
void addTextTexture (int a, int b, int c, int d, const std::string &text, const GeomColor &color=GeomColor(255, 255, 255, 255), int textSize=30, core::scalemode sm=core::interpolateLIN)
 convenience method for creation of a text-texture with auto-normals More...
 
ICLGeom_API void addText (int a, const std::string &text, float billboardHeight=10, const GeomColor &color=GeomColor(255, 255, 255, 255), int textRenderSize=30, core::scalemode sm=core::interpolateLIN)
 adds a billboard text-texture attached to given node index a More...
 
void addCustomPrimitive (Primitive *p)
 adds a custom primitive More...
 
SceneObjectaddCube (float x, float y, float z, float d)
 adds a cube child-object with given parameters More...
 
ICLGeom_API SceneObjectaddCuboid (float x, float y, float z, float dx, float dy, float dz)
 adds a cuboid child-object with given parameters More...
 
SceneObjectaddSphere (float x, float y, float z, float r, int rzSteps, int xySlices)
 adds a cuboid child-object with given parameters More...
 
ICLGeom_API SceneObjectaddSpheroid (float x, float y, float z, float rx, float ry, float rz, int rzSteps, int xySlices)
 adds a cuboid child-object with given parameters More...
 
ICLGeom_API SceneObjectaddCylinder (float x, float y, float z, float rx, float ry, float h, int steps)
 adds a cylindical child object with given parameters More...
 
ICLGeom_API SceneObjectaddCone (float x, float y, float z, float rx, float ry, float h, int steps)
 adds a conical child object with given parameters More...
 
ICLGeom_API void setColor (Primitive::Type t, const GeomColor &color, bool recursive=true)
 tints all Primitives with given type in given color More...
 
ICLGeom_API void setPointSize (float pointSize, bool recursive=true)
 sets point size More...
 
ICLGeom_API void setLineWidth (float lineWidth, bool recursive=true)
 sets point size More...
 
ICLGeom_API void setUseCustomRender (bool use, bool recursive=true)
 if set, only custom render is used More...
 
virtual ICLGeom_API SceneObjectcopy () const
 performs a deep copy of this object More...
 
virtual void customRender ()
 this function is called when an object is rendered More...
 
ICLGeom_API void setColorsFromVertices (Primitive::Type t, bool on, bool recursive=true)
 sets how 2D-geom colors are set More...
 
ICLGeom_API bool getSmoothShading () const
 returns wheather smooth shading is activated More...
 
ICLGeom_API void setSmoothShading (bool on, bool recursive=true)
 sets whether to use smoothshading (default is false) More...
 
ICLGeom_API void createAutoNormals (bool smooth=true)
 automatically creates precomputed normals More...
 
virtual GeomColor getDefaultVertexColor () const
 can be reimplemented by subclass to provide and interface for setting default vertex color More...
 
ICLGeom_API Hit hit (const ViewRay &v, bool recursive=true)
 returns whether this object is hit by the given viewray More...
 
const Hit hit (const ViewRay &v, bool recursive=true) const
 returns whether this object is hit by the given viewray (const) More...
 
ICLGeom_API std::vector< Hithits (const ViewRay &v, bool recursive=true)
 returns all hits with SceneObjects form the given viewray More...
 
ICLGeom_API std::vector< VecgetTransformedVertices () const
 returns all vertices in their final world coordinates More...
 
ICLGeom_API Vec getClosestVertex (const Vec &pWorld, bool relative=false)
 returns the vertex, that is closest to the given point in wold coordinates More...
 
ICLGeom_API void setVisible (bool visible, bool recursive=true)
 sets the visibility of this object More...
 
bool isVisible () const
 returns whether this object is currently visible More...
 
void hide (bool recursive=true)
 calls setVisible(false) More...
 
void show (bool recursive=true)
 calls setVisible(true) More...
 
void setLockingEnabled (bool enabled)
 sets locking enabled or disabled More...
 
bool getLockingEnabled () const
 returns whether locking is current enabled for this object More...
 
virtual void lock () const
 locks the internal mutex if locking enabled is set to true More...
 
virtual void unlock () const
 unlocks the internal mutex if locking enabled is set to true More...
 
void setPointSmoothingEnabled (bool enabled=true)
 sets whether points are visualized in a smoothed manner More...
 
void setLineSmoothingEnabled (bool enabled=true)
 sets whether lines are visualized in a smoothed manner More...
 
void setPolygonSmoothingEnabled (bool enabled=true)
 sets whether faces are visualized in a smoothed manner More...
 
ICLGeom_API void clearAllPrimitives ()
 deletes and removes all primitives More...
 
virtual ICLGeom_API void clearObject (bool deleteAndRemoveChildren=true, bool resetTransform=false)
 deletes all primitive and all vertex, color and normal content (and optionally also the children) More...
 
ICLGeom_API void createDisplayList ()
 creates a displaylist in the next render cycle More...
 
ICLGeom_API void freeDisplayList ()
 frees the displaylist in the next render cycle More...
 
ICLGeom_API void setFragmentShader (qt::GLFragmentShader *shader)
 sets a fragment shader to use for this object More...
 
qt::GLFragmentShadergetFragmentShader ()
 returns the current fragment shader (or NULL if non was given) More...
 
const qt::GLFragmentShadergetFragmentShader () const
 returns the current fragment shader (or NULL if non was given, const version) More...
 
void setCastShadowsEnabled (bool castShadows=true)
 
bool getCastShadowsEnabled ()
 
void setReceiveShadowsEnabled (bool receiveShadows=true)
 
bool getReceiveShadowsEnabled ()
 
void setShininess (icl8u value)
 sets the material shininess (default is 128) More...
 
void setSpecularReflectance (const GeomColor &values)
 sets the materials specular reflectance More...
 
bool getDepthTestEnabled () const
 returns whether depth test is enabled for this object More...
 
void setDepthTestEnabled (bool enabled, bool recursive=true)
 sets whether depth test is enabled for this object More...
 
float getPointHitMaxDistance () const
 returns the maximum distance to a pointing viewraw More...
 
void setPointHitMaxDistance (float d)
 sets the maximum distance to a pointing view-ray More...
 
ICLGeom_API void removeTransformation ()
 sets the internal transformation to the identity matrix More...
 
template<class T >
void transform (const T &m)
 utility method for passing arbitrary matrix classes More...
 
virtual ICLGeom_API void rotate (float rx, float ry, float rz, icl::math::AXES axes=icl::math::AXES_DEFAULT)
 rotates the scene object (this affects it's transformation matrix) More...
 
template<class T >
void rotate (const T &t, icl::math::AXES axes=icl::math::AXES_DEFAULT)
 utility wrapper for vector based rotation More...
 
virtual ICLGeom_API void translate (float dx, float dy, float dz)
 translates the scene object (this affects it's translates matrix) More...
 
template<class T >
void translate (const T &t)
 utility wrapper for vector based translation More...
 
virtual ICLGeom_API void scale (float sx, float sy, float sz)
 transformes the current transformation matrix by a scale matrix More...
 
template<class T >
void scale (const T &t)
 utility wrapper for vector based scaling More...
 
ICLGeom_API Mat getTransformation (bool relative=false) const
 returns the current transformation matrix More...
 
ICLGeom_API bool hasTransformation (bool relative=false) const
 returns whether the SceneObject has currently a non-ID-transformation More...
 
ICLGeom_API SceneObjectgetParent ()
 returns the parent scene object More...
 
ICLGeom_API const SceneObjectgetParent () const
 returns the parent scene object (const version) More...
 
ICLGeom_API void addChild (SceneObject *child, bool passOwnerShip=true)
 adds a new child to this scene object More...
 
void addChild (utils::SmartPtr< SceneObject > child)
 directly passes a smart pointer as a child More...
 
ICLGeom_API void removeChild (SceneObject *child)
 removes given child More...
 
ICLGeom_API void removeAllChildren ()
 removes all children More...
 
ICLGeom_API bool hasChildren () const
 returns whether the SceneObject has children at all More...
 
ICLGeom_API int getChildCount () const
 returns the number of children More...
 
ICLGeom_API SceneObjectgetChild (int index)
 returns child at given index More...
 
ICLGeom_API const SceneObjectgetChild (int index) const
 returns child at given index (const) More...
 
utils::SmartPtr< SceneObjectgetChildPtr (int index)
 returns a shared pointer to the child at given index More...
 
ICLGeom_API bool hasChild (const SceneObject *o) const
 returns whether the given object is a child of this one More...
 
- Public Member Functions inherited from icl::utils::Configurable
virtual ~Configurable ()
 virtual destructor More...
 
 Configurable (const Configurable &other)
 Copy constructor. More...
 
Configurableoperator= (const Configurable &other)
 Assignment operator. More...
 
void setConfigurableID (const std::string &ID)
 sets the ID of this configurable More...
 
const std::string & getConfigurableID () const
 returns the configurables static ID More...
 
bool isOrderedFlagSet () const
 returns whether the ordered flag is set More...
 
void deactivateProperty (const std::string &pattern)
 adds an additional deativation pattern More...
 
void deleteDeactivationPattern (const std::string &pattern)
 removed a formerly added deactivation pattern More...
 
std::vector< std::string > getPropertyListWithoutDeactivated () const
 this returns a filtered list of properties (using all filters added by deactivateProperty) More...
 
virtual void adaptProperty (const std::string &name, const std::string &newType, const std::string &newInfo, const std::string &newToolTip)
 this function can be used to adapt a specific property afterwards More...
 
void registerCallback (const Callback &cb)
 add a callback for changed properties More...
 
void removedCallback (const Callback &cb)
 removes a callback that was registered before More...
 
void syncChangesTo (Configurable *others, int num=1)
 this can be used to let this instance also apply property changes to others More...
 
virtual void setPropertyValue (const std::string &propertyName, const Any &value)
 sets a property value More...
 
virtual std::vector< std::string > getPropertyList () const
 returns a list of All properties, that can be set using setProperty More...
 
virtual bool supportsProperty (const std::string &propertyName) const
 base implementation for property check (seaches in the property list) More...
 
virtual void saveProperties (const std::string &filename, const std::vector< std::string > &propertiesToSkip=EMPTY_VEC) const
 writes all available properties into a file More...
 
virtual void loadProperties (const std::string &filename, const std::vector< std::string > &propertiesToSkip=EMPTY_VEC)
 reads a camera config file from disc More...
 
virtual std::string getPropertyType (const std::string &propertyName) const
 get type of property More...
 
virtual std::string getPropertyInfo (const std::string &propertyName) const
 get information of a properties valid values More...
 
virtual Any getPropertyValue (const std::string &propertyName) const
 returns the current value of a property or a parameter More...
 
virtual std::string getPropertyToolTip (const std::string &propertyName) const
 returns the tooltip description for a given property More...
 
virtual int getPropertyVolatileness (const std::string &propertyName) const
 Returns whether this property may be changed internally. More...
 

Public Attributes

utils::SmartPtr< Shadowm_shadow
 

Private Types

typedef std::map< std::string, VertexAttractor * > AttractorMap
 

Private Attributes

std::vector< SceneObject * > nodes
 
AttractorMap attractors
 
PhysicsWorldworld
 
geom::Scenescene
 
utils::Mutex attractorMutex
 
utils::SmartPtr< qt::MouseHandlermouse
 
std::vector< LineAnnotation * > lines
 
DraggedPositionIndicatordraggedPositionIndicator
 
bool showAllConstraints
 

Friends

class ManipulatablePaperMouseHandler
 

Additional Inherited Members

- Public Types inherited from icl::utils::Configurable
typedef Function< void, const Property & > Callback
 Function type for changed properties. More...
 
- Static Public Member Functions inherited from icl::geom::SceneObject
static SceneObjectcube (float x, float y, float z, float r)
 create a cube scene object More...
 
static SceneObjectcuboid (float x, float y, float z, float dx, float dy, float dz)
 create a cuboid scene object More...
 
static SceneObjectsphere (float x, float y, float z, float r, int rzSteps, int xySlices)
 create a shere scene object More...
 
static SceneObjectspheroid (float x, float y, float z, float rx, float ry, float rz, int rzSteps, int xySlices)
 create a shere scene object More...
 
static SceneObjectsuperquadric (float x, float y, float z, float rx, float ry, float rz, float dx, float dy, float dz, float e1, float e2, int rzSteps, int xySlices)
 create a superquadric scene object More...
 
- Static Public Member Functions inherited from icl::utils::Configurable
static std::string create_default_ID (const std::string &prefix)
 this function can be used in subclasses to create a default ID More...
 
static Configurableget (const std::string &id)
 returns configurable by given ID More...
 
static void register_configurable_type (const std::string &classname, Function< Configurable * > creator)
 registers a configurable type More...
 
static std::vector< std::string > get_registered_configurables ()
 returns a list of all registered configurable classnames More...
 
static Configurablecreate_configurable (const std::string &classname)
 creates a configurable by given name More...
 
- Static Public Attributes inherited from icl::utils::Configurable
static const std::vector< std::string > EMPTY_VEC
 used as shortcut – just an empty vector of std::strings More...
 
- Protected Member Functions inherited from icl::physics::PhysicsPaper
void randomizeLinks ()
 
- Protected Member Functions inherited from icl::physics::SoftObject
 SoftObject ()
 protected constructor .. More...
 
void createAllProperties ()
 this MUST be called by the real implementation class AFTER the real softbody instance is created More...
 
- Protected Member Functions inherited from icl::utils::Uncopyable
 Uncopyable ()
 Empty base constructor. More...
 
- Protected Member Functions inherited from icl::utils::Configurable
void addProperty (const std::string &name, const std::string &type, const std::string &info, const Any &value=Any(), const int volatileness=0, const std::string &tooltip=std::string())
 This can be used by derived classes to store supported properties in the internal list. More...
 
void addChildConfigurable (Configurable *configurable, const std::string &childPrefix="")
 This adds another configurable as child. More...
 
void removeChildConfigurable (Configurable *configurable)
 removes the given child configurable More...
 
Propertyprop (const std::string &propertyName)
 this CAN be used e.g. to store a property value in internal property-list More...
 
const Propertyprop (const std::string &propertyName) const
 this CAN be used e.g. to store a property value in internal property-list More...
 
 Configurable (const std::string &ID="", bool ordered=true)
 create this configurable with given ID More...
 
void call_callbacks (const std::string &propertyName, const Configurable *caller) const
 calls all registered callbacks More...
 
- Static Protected Member Functions inherited from icl::geom::SceneObject
static void collect_hits_recursive (SceneObject *obj, const ViewRay &v, std::vector< Hit > &hits, bool recursive)
 recursive picking method More...
 
- Protected Attributes inherited from icl::physics::PhysicsPaper
std::vector< BendingConstraintconstraints
 
std::vector< float > originalRestLengths
 
- Protected Attributes inherited from icl::physics::PhysicsObject
bool m_stateChanged
 is true if the physical state of the object has changed since the last updateSceneObject() More...
 
utils::Function< void, PhysicsObject *, PhysicsObject *, geom::Vecm_collisionCallback
 
std::string m_id
 
- Protected Attributes inherited from icl::geom::SceneObject
std::vector< Vecm_vertices
 
std::vector< Vecm_normals
 
std::vector< GeomColorm_vertexColors
 
std::vector< Primitive * > m_primitives
 
std::vector< utils::SmartPtr< qt::GLImg > > m_sharedTextures
 
int m_visibleMask
 
bool m_lineColorsFromVertices
 
bool m_triangleColorsFromVertices
 
bool m_quadColorsFromVertices
 
bool m_polyColorsFromVertices
 
bool m_useCustomRender
 
float m_pointSize
 
float m_lineWidth
 
bool m_useSmoothShading
 
bool m_isVisible
 
Mat m_transformation
 for the scene graph implementation More...
 
bool m_hasTransformation
 
SceneObjectm_parent
 
std::vector< utils::SmartPtr< SceneObject > > m_children
 
utils::Mutex m_mutex
 for asynchronous updates More...
 
bool m_enableLocking
 can be enabled More...
 
bool m_pointSmoothingEnabled
 
bool m_lineSmoothingEnabled
 
bool m_polygonSmoothingEnabled
 
bool m_depthTestEnabled
 default is true More...
 
icl8u m_shininess
 
GeomColor m_specularReflectance
 
- Protected Attributes inherited from icl::utils::Configurable
std::vector< Callbackcallbacks
 internally managed list of callbacks More...
 

Detailed Description

extension of the standard physical paper class

Member Typedef Documentation

◆ AttractorMap

typedef std::map<std::string,VertexAttractor*> icl::physics::ManipulatablePaper::AttractorMap
private

Constructor & Destructor Documentation

◆ ManipulatablePaper()

icl::physics::ManipulatablePaper::ManipulatablePaper ( PhysicsWorld world,
geom::Scene scene,
int  W,
int  H,
const geom::Vec init,
bool  initByCorners,
const core::Img8u frontTexture = 0,
const core::Img8u backTexture = 0 
)

create with given parameters

Member Function Documentation

◆ adaptColStiffness()

virtual void icl::physics::ManipulatablePaper::adaptColStiffness ( float  val,
int  col 
)
virtual

adation to base class (colors the cubes)

Reimplemented from icl::physics::PhysicsPaper.

◆ adaptGlobalStiffness()

virtual void icl::physics::ManipulatablePaper::adaptGlobalStiffness ( float  val)
virtual

adation to base class (colors the cubes)

Reimplemented from icl::physics::PhysicsPaper.

◆ adaptRowStiffness()

virtual void icl::physics::ManipulatablePaper::adaptRowStiffness ( float  val,
int  row 
)
virtual

adation to base class (colors the cubes)

Reimplemented from icl::physics::PhysicsPaper.

◆ adaptStiffnessAlongLine()

void icl::physics::ManipulatablePaper::adaptStiffnessAlongLine ( const utils::Point32f a,
const utils::Point32f b,
float  val 
)

adapts all constraints, that intersect the given 2D line (using the current camera)

Actually, this function will just use the current camera position to create a PlaneEquation that is passed the parent PhysicsPaper::adaptStiffnessAlongIntersection method

◆ addAttractor()

void icl::physics::ManipulatablePaper::addAttractor ( utils::Point  coords,
bool  oscillating = false 
)

adds a new attractor at given coordinates

◆ addLineAnnotation()

void icl::physics::ManipulatablePaper::addLineAnnotation ( const utils::Point32f a,
const utils::Point32f b,
const geom::GeomColor color = geom::GeomColor(255, 100, 0, 255) 
)

adds a line annotation (given in paper coordinats=;

◆ addShadow()

void icl::physics::ManipulatablePaper::addShadow ( float  zLevel)
inline

◆ applyAllForces()

void icl::physics::ManipulatablePaper::applyAllForces ( float  attractorForce,
float  mouseForce 
)

applies all attractors and optional mouse force

◆ complexCustomRender()

virtual void icl::physics::ManipulatablePaper::complexCustomRender ( icl::geom::ShaderUtil u)
virtual

custom rendering for constraint visualization

Reimplemented from icl::geom::SceneObject.

◆ createMouseHandler()

qt::MouseHandler* icl::physics::ManipulatablePaper::createMouseHandler ( int  cameraIndex = 0)

creates a mouse handler using the internal scene

◆ getPaperCoordinates() [1/2]

utils::Point32f icl::physics::ManipulatablePaper::getPaperCoordinates ( const utils::Point32f screenPosition2D)

returns the paper position for a given 2D screen position or (-1,-1) if not found

◆ getPaperCoordinates() [2/2]

utils::Point32f icl::physics::PhysicsPaper::getPaperCoordinates

import name for parent class

◆ getPos()

geom::Vec icl::physics::ManipulatablePaper::getPos ( const utils::Point idx)

get's current position of node at given coorndinats

◆ getShowAllConstraints()

bool icl::physics::ManipulatablePaper::getShowAllConstraints ( ) const
inline

returns whether constraints are shown

◆ loadCFG()

virtual void icl::physics::ManipulatablePaper::loadCFG ( const std::string &  filename)
virtual

loads current constraints

◆ prepareForRendering()

void icl::physics::ManipulatablePaper::prepareForRendering ( )
virtual

updates all cubes from the underlying paper

Reimplemented from icl::physics::PhysicsObject.

◆ removeAllAnnoations()

void icl::physics::ManipulatablePaper::removeAllAnnoations ( )

◆ removeAllAttractors()

void icl::physics::ManipulatablePaper::removeAllAttractors ( )

removes all current attractors

◆ removeAllLineAnnoations()

void icl::physics::ManipulatablePaper::removeAllLineAnnoations ( )

removes all line annotations

◆ removeAttractor()

void icl::physics::ManipulatablePaper::removeAttractor ( utils::Point  coords)

removes an attractor at given coordinates

◆ saveCFG()

virtual void icl::physics::ManipulatablePaper::saveCFG ( const std::string &  filename)
virtual

saves the current constraints

◆ setCubesVisible()

void icl::physics::ManipulatablePaper::setCubesVisible ( bool  on)

sets whether the handle cubes are visible

◆ setDraggedPosition()

void icl::physics::ManipulatablePaper::setDraggedPosition ( const utils::Point32f paperPos)

adds a highlight at given position

◆ setShowAllConstraints()

void icl::physics::ManipulatablePaper::setShowAllConstraints ( bool  show)
inline

sets whether contraints are visualized

◆ setTextureVisible()

void icl::physics::ManipulatablePaper::setTextureVisible ( bool  on)

sets texture or shaded mode

Friends And Related Function Documentation

◆ ManipulatablePaperMouseHandler

friend class ManipulatablePaperMouseHandler
friend

Member Data Documentation

◆ attractorMutex

utils::Mutex icl::physics::ManipulatablePaper::attractorMutex
private

◆ attractors

AttractorMap icl::physics::ManipulatablePaper::attractors
private

◆ draggedPositionIndicator

DraggedPositionIndicator* icl::physics::ManipulatablePaper::draggedPositionIndicator
private

◆ lines

std::vector<LineAnnotation*> icl::physics::ManipulatablePaper::lines
private

◆ m_shadow

utils::SmartPtr<Shadow> icl::physics::ManipulatablePaper::m_shadow

◆ mouse

utils::SmartPtr<qt::MouseHandler> icl::physics::ManipulatablePaper::mouse
private

◆ nodes

std::vector<SceneObject *> icl::physics::ManipulatablePaper::nodes
private

◆ scene

geom::Scene* icl::physics::ManipulatablePaper::scene
private

◆ showAllConstraints

bool icl::physics::ManipulatablePaper::showAllConstraints
private

◆ world

PhysicsWorld* icl::physics::ManipulatablePaper::world
private

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