Structural deformable models
Main Page
Namespaces
Classes
Files
File List
File Members
src
Node.h
Go to the documentation of this file.
1
/* -*- C++ -*- */
2
#ifndef _NODE_H_
3
#define _NODE_H_
4
5
#include <iostream>
6
#include <vector>
7
#include "
Point.h
"
8
#include "
PartParam.h
"
9
10
#include "
types_fwd.h
"
11
13
class
Node
:
public
Point
{
14
friend
class
Model
;
15
public
:
16
enum
NodeState
{
ST_NONE
=0,
ST_HIGHLIGHT
=1,
ST_SELECT
=2 };
17
19
Node
(
const
ParticleParam
*
phys
= &
ParticleParam::global
);
21
Node
(
const
Node
& rhs) {
operator=
(rhs); }
23
Node
(
float
_x,
float
_y,
const
ParticleParam
*
phys
=&
ParticleParam::global
);
25
virtual
~Node
() {};
27
Node
&
operator=
(
const
Node
&rhs);
28
Node
&
setPos
(
const
Point
& p) {
29
Point::operator=
(p);
30
return
*
this
;
31
}
33
int
getIndex
()
const
{
return
index
; }
35
friend
std::ostream&
operator<<
(std::ostream &os,
const
Node
&n);
36
void
attachSensor
(
sensor_cptr
_sensor);
37
void
addSensorForce
();
38
void
enableState
(
dword
nstate) {
state
|= nstate; }
39
void
disableState
(
dword
nstate=0xffffffff) {
state
&= ~nstate; }
40
void
toggleState
(
dword
nstate) {
state
^= nstate; }
41
bool
hasState
(
dword
nstate=0xffffffff)
const
{
return
state
& nstate; }
42
void
draw
()
const
;
43
sensor_cptr
sensor
;
44
std::string
sensorID
;
45
46
public
:
48
float
mass
;
49
50
protected
:
52
Point
v
,
f
;
54
Point
ef
;
56
int
index
;
57
float
oangle
;
58
float
cangle
;
59
float
nedges
;
60
std::vector<int>
edges
;
61
dword
state
;
62
};
63
64
#endif
Node::cangle
float cangle
Definition:
Node.h:58
ParticleParam::global
static ParticleParam global
Definition:
PartParam.h:72
ParticleParam
Definition:
PartParam.h:25
Node::attachSensor
void attachSensor(sensor_cptr _sensor)
Definition:
Node.cpp:50
Node
Implements a Node used by Model and Edge.
Definition:
Node.h:13
Node::toggleState
void toggleState(dword nstate)
Definition:
Node.h:40
Node::edges
std::vector< int > edges
Definition:
Node.h:60
Node::nedges
float nedges
Definition:
Node.h:59
Point.h
Node::f
Point f
Definition:
Node.h:52
Node::mass
float mass
Mass.
Definition:
Node.h:48
Node::getIndex
int getIndex() const
Definition:
Node.h:33
Model::phys
ParticleParam phys
physical parameter set
Definition:
Model.h:257
Node::disableState
void disableState(dword nstate=0xffffffff)
Definition:
Node.h:39
Node::setPos
Node & setPos(const Point &p)
Definition:
Node.h:28
Node::ef
Point ef
extern force
Definition:
Node.h:54
Node::draw
void draw() const
Definition:
Node.cpp:69
Point2D::operator=
Point2D & operator=(const Point2D &rhs)
Definition:
Point.h:27
Node::Node
Node(const ParticleParam *phys=&ParticleParam::global)
Default constructor.
Definition:
Node.cpp:7
Node::index
int index
Index in the list (Model.nodes)
Definition:
Node.h:56
Node::sensor
sensor_cptr sensor
Definition:
Node.h:43
Node::addSensorForce
void addSensorForce()
Definition:
Node.cpp:62
Node::ST_SELECT
Definition:
Node.h:16
Node::Node
Node(const Node &rhs)
Assignment constructor.
Definition:
Node.h:21
Node::ST_HIGHLIGHT
Definition:
Node.h:16
Model
Definition:
Model.h:33
Node::v
Point v
Velocity and Force.
Definition:
Node.h:52
Node::ST_NONE
Definition:
Node.h:16
dword
unsigned long dword
Definition:
simpletypes.h:6
Node::hasState
bool hasState(dword nstate=0xffffffff) const
Definition:
Node.h:41
Node::~Node
virtual ~Node()
Destructor.
Definition:
Node.h:25
Node::operator=
Node & operator=(const Node &rhs)
Assignment operator.
Definition:
Node.cpp:21
types_fwd.h
Node::operator<<
friend std::ostream & operator<<(std::ostream &os, const Node &n)
output operator
Definition:
Node.cpp:38
Node::state
dword state
Definition:
Node.h:61
Node::sensorID
std::string sensorID
Definition:
Node.h:44
sensor_cptr
std::shared_ptr< const Sensor > sensor_cptr
Definition:
types_fwd.h:17
Point2D
Definition:
Point.h:16
Node::NodeState
NodeState
Definition:
Node.h:16
Node::enableState
void enableState(dword nstate)
Definition:
Node.h:38
Node::oangle
float oangle
Definition:
Node.h:57
PartParam.h
Generated by
1.8.11