50 #define POLYLINEOBJECT_C 106 if (
line_ != NULL) {
110 std::cerr <<
"Destructor error : Line already deleted" << std::endl;
122 if (
line_ != NULL) {
126 std::cerr <<
"Cleanup error : Line already deleted" << std::endl;
158 line()->request_vertex_selections();
159 line()->request_edge_selections();
160 line()->request_vertex_vhandles();
161 line()->request_vertex_ehandles();
162 line()->request_vertex_fhandles();
166 std::cerr <<
"Error when creating Line Object! materialNode is NULL!" << std::endl;
188 std::string nodename = std::string(
"LineNode for Line " + _name.toUtf8() );
228 output +=
"========================================================================\n";
232 output +=
"Object Contains PolyLine : ";
234 output += QString::number(
line()->n_vertices() ) +
" vertices, ";
235 output += QString::number(
line()->n_edges() ) +=
" edges and is ";
236 if (
line()->is_closed() )
237 output +=
"closed.\n";
241 output +=
"========================================================================\n";
272 const unsigned int _targetIdx )
287 if(eh >= 0 && eh < (
int)
line()->n_edges())
305 if(vh>=0 && vh < (
int)
line()->n_vertices())
PolyLineObject()
constructor
virtual void update(UpdateType _type=UPDATE_ALL)
This function is called to update the object.
Point & point(unsigned int _i)
Get a point of the polyline.
virtual QString getObjectinfo()
Get all Info for the Object as a string.
PolyLine * line_
Pointer to the polyline.
void set_round_points(bool _b)
set round points enabled
MaterialNode * materialNode()
get a pointer to the materialnode
void setDataType(DataType _type)
void deleteData()
Delete all data attached to this object ( calls delete on each object )
ACG::SceneGraph::PolyLineNodeT< PolyLine > * lineNode_
Scenegraph Mesh Node.
PolyLine * line()
return a pointer to the line
Vec::value_type distPointLineSquared(const Vec &_p, const Vec &_v0, const Vec &_v1, Vec *_min_v)
squared distance from point _p to line segment (_v0,_v1)
virtual void setName(QString _name)
path to the file from which the object is loaded ( defaults to "." )
QString name() const
return the name of the object. The name defaults to NONAME if unset.
void set_line_width(float _sz)
set line width (default: 1.0)
void enablePicking(bool _enable)
Enable or disable picking for this Object.
ACG::SceneGraph::PolyLineNodeT< PolyLine > * lineNode()
Get the scenegraph Node.
bool pickingEnabled()
Check if picking is enabled for this Object.
picks edges (may not be implemented for all nodes)
void set_random_color()
Generates a random color and sets it.
virtual void init(PolyLine *_line=0)
Initialise current object, including all related nodes.
void set_point_size(float _sz)
set point size (default: 1.0)
PickTarget
What target to use for picking.
virtual ~PolyLineObject()
destructor
void setName(QString _name)
Set the name of the Object.
picks faces (should be implemented for all nodes)
bool picked(uint _node_idx)
detect if the node has been picked
QString getObjectinfo()
Get all Info for the Object as a string.
ACG::PolyLineT< ACG::Vec3d > PolyLine
Simple Name for PolyLine.
ACG::Vec3d refinePick(ACG::SceneGraph::PickTarget _pickTarget, const ACG::Vec3d _hitPoint, const ACG::Vec3d _start, const ACG::Vec3d _dir, const unsigned int _targetIdx)
Refine picking on triangle meshes.
virtual void cleanup()
Reset current object, including all related nodes.
picks verices (may not be implemented for all nodes)
DataType dataType() const