AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
agxWire::EyeNode Class Reference

Eye node is a type of node that can slide along a wire with or without friction. More...

#include <Node.h>

+ Inheritance diagram for agxWire::EyeNode:

Public Member Functions

 EyeNode (agx::RigidBody *rb, agx::Real radius=agx::Real(0))
 Construct a sliding node given a body and a radius.
 
 EyeNode (agx::RigidBody *rb, agx::Real relTranslate_x, agx::Real relTranslate_y, agx::Real relTranslate_z, const agx::Vec3 &extraEyeVector=agx::Vec3(), agx::Real radius=agx::Real(0))
 Construct a sliding node given a body, model center offset and a radius.
 
 EyeNode (agx::RigidBody *rb, const agx::Vec3 &relativeTranslate, agx::Real radius=agx::Real(0))
 Construct a sliding node given a body, model center offset and a radius.
 
 EyeNode (agx::RigidBody *rb, const agx::Vec3 &relativeTranslate, const agx::Vec3 &extraEyeVector, agx::Real radius=agx::Real(0))
 Construct a sliding node given a body, model center offset and a radius.
 
 AGXSTREAM_DECLARE_SERIALIZABLE_BASE (agxWire::EyeNode)
 
agx::Real findSpeedAlongWire (const agxWire::Wire *wire) const
 Calculates the speed in which this eye node travels along a wire.
 
EyeNode * getChildNode ()
 
const EyeNode * getChildNode () const
 
agx::Real getDistanceToChild () const
 
bool getFixFrictionDirection () const
 
EyeNode * getParentNode () const
 
agx::Real getRadius () const
 
bool getReverseAdd () const
 
agx::Vec3 getVectorToChild () const
 
virtual void reverse () override
 Only for internal use! Reverse all direction dependent internal structures.
 
void setFixFrictionDirection (bool fixFrictionDirection, bool goForward)
 Assign fixed friction direction for this eye node.
 
void setRadius (agx::Real radius)
 Set the radius of this eye node.
 
void setReverseAdd (bool reverseAdd)
 If this node has a child node, this parameter controls in which order the nodes (parent and child) gets added/inserted into the wire.
 
void setVectorToChild (const agx::Vec3 &vec)
 set the relative translation from this node to its child node (if child present)
 
- Public Member Functions inherited from agxWire::Node
void addState (int state)
 Add state mask to the current state.
 
BodyFixedNode * getAsBodyFixed ()
 
const BodyFixedNode * getAsBodyFixed () const
 
ConnectingNode * getAsConnecting ()
 
const ConnectingNode * getAsConnecting () const
 
ContactNode * getAsContact ()
 
const ContactNode * getAsContact () const
 
EyeNode * getAsEye ()
 
const EyeNode * getAsEye () const
 
EyeNode * getAsEyeLineNode ()
 
const EyeNode * getAsEyeLineNode () const
 
FreeNode * getAsFree ()
 
const FreeNode * getAsFree () const
 
ShapeContactNode * getAsShapeContact ()
 
const ShapeContactNode * getAsShapeContact () const
 
StopNode * getAsStop ()
 
const StopNode * getAsStop () const
 
agx::Referenced * getCustomData () const
 
NodeFrame * getFrame ()
 
const NodeFrame * getFrame () const
 
HighResolutionRange * getHighResolutionRange ()
 
const HighResolutionRange * getHighResolutionRange () const
 
bool getIgnoreBend () const
 
agx::Vec3 getIntegratedPosition (agx::Real t, bool onlyTranslational=true) const
 Calculates the position of this node at time t from now.
 
NodeMaterial * getMaterial ()
 
const NodeMaterial * getMaterial () const
 
NodeFrame & getNodeFrame ()
 
Type getNodeType () const
 
const agx::Vec3 & getPosition () const
 
agx::RigidBody * getRigidBody () const
 
int getState () const
 
const agx::Vec3 & getTranslate () const
 
Node::Type getType () const
 
virtual agx::Vec3 getVelocity () const
 
const agx::Vec3 & getWorldPosition () const
 
agx::Bool isType (agx::Int typeMask) const
 Test several types, e.g., node->isType( agxWire::Node::EYE | agxWire::Node::CONNECTING ).
 
void removeState (int state)
 Remove state mask from the current state.
 
virtual void reverse ()
 Only for internal use! Reverses all, internal, direction dependent structures.
 
void setCustomData (agx::Referenced *customData)
 Set custom data to this node.
 
void setIgnoreBend (bool ignoreBend)
 Flag if bend constraints should be ignored over this node.
 
void setTranslate (agx::Real x, agx::Real y, agx::Real z)
 Set the relative translate of this node in parent frame (body frame if body is set, otherwise world frame)
 
virtual void setTranslate (const agx::Vec3 &translate)
 Set the relative translate of this node in parent frame (body frame if body is set, otherwise world frame)
 
void transform ()
 Transforms the frame.
 
- Public Member Functions inherited from agx::Referenced
 Referenced ()
 Default constructor.
 
 Referenced (const Referenced &)
 
template<typename T >
T * as ()
 Subclass casting.
 
template<typename T >
const T * as () const
 
template<typename T >
T * asSafe ()
 Safe subclass casting, return nullptr if template type does not match.
 
template<typename T >
const T * asSafe () const
 
int getReferenceCount () const
 
template<typename T >
bool is () const
 Subclass test.
 
Referenced & operator= (const Referenced &)
 Assignment operator. Will increment the number of references to the referenced object.
 
void reference (void *ptr=nullptr) const
 Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.
 
void unreference (void *ptr=nullptr) const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 
void unreference_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 
- Public Member Functions inherited from agxStream::Serializable
virtual ~Serializable ()
 Destructor for normal C++ use but hidden from SWIG bindings.
 
virtual const char * getClassName () const
 
bool getEnableSerialization () const
 
bool getEnableUuidGeneration ()
 
agx::UInt32 getIndex () const
 This index is given at creation of this object.
 
virtual StorageAgent * getStorageAgent () const =0
 
agx::Uuid getUuid () const
 
bool isFinished () const
 
void setEnableSerialization (bool flag)
 Set to false to disable serialization of this object.
 
void setFinished ()
 Tells this class that it is restored correctly and should not be deleted during destruction of an Archive.
 
void setUuid (const agx::Uuid &uuid)
 Explicitly set a Uuid on a serializable object.
 

Static Public Member Functions

static agxStream::Serializable * create (agxStream::InputArchive &)
 
- Static Public Member Functions inherited from agxWire::Node
static int findNodeState (const agxCollide::Geometry *geometry)
 Class used to track nodes when CCD is used.
 
static agx::Bool isContactType (const Node *node)
 
static agx::Bool isContactType (const Node::Type &type)
 
- Static Public Member Functions inherited from agx::Referenced
template<typename T >
static bool ValidateCast (const Referenced *object)
 
- Static Public Member Functions inherited from agxStream::Serializable
static void setEnableUuidGeneration (bool flag)
 Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled.
 

Protected Member Functions

 EyeNode ()
 Protected default constructor.
 
 EyeNode (Type type, agx::Real radius=agx::Real(0))
 Protected constructor used by other nodes.
 
virtual ~EyeNode ()
 Destructor.
 
void create (agx::RigidBody *rb, const agx::Vec3 &relativeTranslate, const agx::Vec3 &extraEyeVector, agx::Real radius)
 Create method used by all public constructors.
 
- Protected Member Functions inherited from agxWire::Node
 Node ()
 Default constructor.
 
 Node (Type type)
 Constructor given general node type.
 
virtual ~Node ()
 Destructor.
 
- Protected Member Functions inherited from agx::Referenced
virtual ~Referenced ()
 Destructor.
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 
- Protected Member Functions inherited from agxStream::Serializable
 Serializable ()
 Default constructor.
 
 Serializable (const Serializable &other)
 Copy constructor.
 
void generateUuid ()
 

Protected Attributes

agx::ref_ptr< EyeNode > m_childNode
 
agx::Vec3 m_normal
 
agx::Real m_radius
 
bool m_reverseAdd
 
- Protected Attributes inherited from agxWire::Node
BodyFixedNode * m_bodyFixed
 
ConnectingNode * m_connecting
 
ContactNode * m_contact
 
ContactForce m_contactForce
 
agx::ref_ptr< agx::Referenced > m_customData
 
EyeNode * m_eye
 
FreeNode * m_free
 
HighResolutionRange m_highResolutionRange
 
NodeMaterial m_material
 
NodeFrame m_nf
 
int m_nodeState
 
agx::observer_ptr< Node > m_parent
 
ShapeContactNode * m_shapeContact
 
SpatialState m_spatialState
 
StopNode * m_stop
 
StoreRestoreData m_storeRestoreData
 
Tension m_tension
 
Type m_type
 
- Protected Attributes inherited from agx::Referenced
Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Additional Inherited Members

- Public Types inherited from agxWire::Node
enum  StateInfo {
  STANDARD = 0 , WAS_CONTACT = (1<< 0) , IS_HIGH_RES = (1<< 1) , IGNORE_BEND = (1<< 2) ,
  NO_LUMP_NEAR = (1<< 3) , NO_CIRCLE_CONTACT = (1<< 4) , GYPSY_CONTACT = (1<< 5) , NO_MOVEMENT_RANGE = (1<< 6) ,
  NO_FRICTION = (1<< 7) , SPLIT_ENABLED = (1<< 8) , INSIDE_OBJECT = (1<< 9) , WAS_CONTACT_LAST_TIMESTEP = (1<<10) ,
  PERMANENT_LUMP = (1<<11) , REPLACE_SUPERBEND_WITH_BEND = (1<<12) , LUMPED_NODE = (1<<13) , LUMP_CONTACT = (1<<14) ,
  WW_STABILIZED = (1<<15)
}
 Internal state a node may have. More...
 
enum  Type {
  NOT_DEFINED = 0 , EYE = (1<<0) , MISSING = (1<<1) , CONNECTING = (1<<2) ,
  FREE = (1<<3) , CONTACT = (1<<4) , BODY_FIXED = (1<<5) , STOP = (1 << 6) ,
  SHAPE_CONTACT = (1<<7)
}
 The supported node types. More...
 
- Static Protected Member Functions inherited from agx::Referenced
static DeleteHandler * getDeleteHandler ()
 
static void setDeleteHandler (DeleteHandler *handler)
 Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
 

Detailed Description

Eye node is a type of node that can slide along a wire with or without friction.

Definition at line 1380 of file agxWire/Node.h.

Constructor & Destructor Documentation

◆ EyeNode() [1/6]

agxWire::EyeNode::EyeNode ( agx::RigidBody *  rb,
agx::Real  radius = agx::Real(0) 
)

Construct a sliding node given a body and a radius.

This node will be located at model center of the body.

Parameters
rb- the body this node should be attached to
radius- radius of this eye node (default: 0)

◆ EyeNode() [2/6]

agxWire::EyeNode::EyeNode ( agx::RigidBody *  rb,
const agx::Vec3 &  relativeTranslate,
agx::Real  radius = agx::Real(0) 
)

Construct a sliding node given a body, model center offset and a radius.

Parameters
rb- the body this node should be attached to
relativeTranslate- body model center offset
radius- radius of this node (default: 0)

◆ EyeNode() [3/6]

agxWire::EyeNode::EyeNode ( agx::RigidBody *  rb,
const agx::Vec3 &  relativeTranslate,
const agx::Vec3 &  extraEyeVector,
agx::Real  radius = agx::Real(0) 
)

Construct a sliding node given a body, model center offset and a radius.

An approach to get the correct geometry of something sliding along the wire, pass the vector from relativeTranslate pointing out where an extra eye node will be created.

Parameters
rb- the body this node should be attached to
relativeTranslate- body model center offset
extraEyeVector- vector pointing out where to put an extra node to achieve plausible geometry of an eye node
radius- radius of this node (default: 0)

◆ EyeNode() [4/6]

agxWire::EyeNode::EyeNode ( agx::RigidBody *  rb,
agx::Real  relTranslate_x,
agx::Real  relTranslate_y,
agx::Real  relTranslate_z,
const agx::Vec3 &  extraEyeVector = agx::Vec3(),
agx::Real  radius = agx::Real(0) 
)

Construct a sliding node given a body, model center offset and a radius.

Optional; to get the correct geometry of something sliding along the wire, pass the vector from relativeTranslate pointing out where an extra eye node will be created.

Parameters
rb- the body this node should be attached to
relTranslate_x- x body model center offset
relTranslate_y- y body model center offset
relTranslate_z- z body model center offset
extraEyeVector- vector pointing out where to put an extra node to achieve plausible geometry of an eye node
radius- radius of this node (default: 0)

◆ EyeNode() [5/6]

agxWire::EyeNode::EyeNode ( )
protected

Protected default constructor.

◆ EyeNode() [6/6]

agxWire::EyeNode::EyeNode ( Type  type,
agx::Real  radius = agx::Real(0) 
)
protected

Protected constructor used by other nodes.

Parameters
type- node type
radius- radius

◆ ~EyeNode()

virtual agxWire::EyeNode::~EyeNode ( )
protectedvirtual

Destructor.

Member Function Documentation

◆ AGXSTREAM_DECLARE_SERIALIZABLE_BASE()

agxWire::EyeNode::AGXSTREAM_DECLARE_SERIALIZABLE_BASE ( agxWire::EyeNode  )

◆ create() [1/2]

void agxWire::EyeNode::create ( agx::RigidBody *  rb,
const agx::Vec3 &  relativeTranslate,
const agx::Vec3 &  extraEyeVector,
agx::Real  radius 
)
protected

Create method used by all public constructors.

Parameters
rb- the body
relativeTranslate- model frame offset
extraEyeVector- if |v| > 0 an extra eye will be created
radius- radius

◆ create() [2/2]

static agxStream::Serializable * agxWire::EyeNode::create ( agxStream::InputArchive &  )
inlinestatic

Definition at line 1513 of file agxWire/Node.h.

◆ findSpeedAlongWire()

agx::Real agxWire::EyeNode::findSpeedAlongWire ( const agxWire::Wire *  wire) const

Calculates the speed in which this eye node travels along a wire.

Parameters
wire- the wire containing this eye node
Returns
speed of this node along wire (0 if not on wire or wire not initialized)

◆ getChildNode() [1/2]

EyeNode * agxWire::EyeNode::getChildNode ( )
Returns
child node if this node carries one

◆ getChildNode() [2/2]

const EyeNode * agxWire::EyeNode::getChildNode ( ) const
Returns
child node if this node carries one

◆ getDistanceToChild()

agx::Real agxWire::EyeNode::getDistanceToChild ( ) const
Returns
the distance from this node to its child node (if child present)

◆ getFixFrictionDirection()

bool agxWire::EyeNode::getFixFrictionDirection ( ) const
Returns
true if this eye has fixed friction direction enabled

◆ getParentNode()

EyeNode * agxWire::EyeNode::getParentNode ( ) const
Returns
the parent node if this is a child

◆ getRadius()

agx::Real agxWire::EyeNode::getRadius ( ) const
Returns
the radius of this eye node (default 0)

◆ getReverseAdd()

bool agxWire::EyeNode::getReverseAdd ( ) const
Returns
true if reverse add is enabled

◆ getVectorToChild()

agx::Vec3 agxWire::EyeNode::getVectorToChild ( ) const
Returns
the relative translation from this node to its child node (if child present)

◆ reverse()

virtual void agxWire::EyeNode::reverse ( )
overridevirtual

Only for internal use! Reverse all direction dependent internal structures.

Reimplemented from agxWire::Node.

◆ setFixFrictionDirection()

void agxWire::EyeNode::setFixFrictionDirection ( bool  fixFrictionDirection,
bool  goForward 
)

Assign fixed friction direction for this eye node.

This is usually used for eye nodes with infinite friction.

Parameters
fixFrictionDirection- true to enable fixed friction direction
goForward- true if the friction constraints should be attached before this node, false means after

◆ setRadius()

void agxWire::EyeNode::setRadius ( agx::Real  radius)

Set the radius of this eye node.

Parameters
radius- new radius (default 0)

◆ setReverseAdd()

void agxWire::EyeNode::setReverseAdd ( bool  reverseAdd)

If this node has a child node, this parameter controls in which order the nodes (parent and child) gets added/inserted into the wire.

Default is that the parent node gets added before the child node.

Parameters
reverseAdd- if true, this child node will be added/inserted before the parent node

◆ setVectorToChild()

void agxWire::EyeNode::setVectorToChild ( const agx::Vec3 &  vec)

set the relative translation from this node to its child node (if child present)

Member Data Documentation

◆ m_childNode

agx::ref_ptr< EyeNode > agxWire::EyeNode::m_childNode
protected

Definition at line 1543 of file agxWire/Node.h.

◆ m_normal

agx::Vec3 agxWire::EyeNode::m_normal
protected

Definition at line 1546 of file agxWire/Node.h.

◆ m_radius

agx::Real agxWire::EyeNode::m_radius
protected

Definition at line 1545 of file agxWire/Node.h.

◆ m_reverseAdd

bool agxWire::EyeNode::m_reverseAdd
protected

Definition at line 1544 of file agxWire/Node.h.


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