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())
virtual QString getObjectinfo()
Get all Info for the Object as a string.
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)
void deleteData()
Delete all data attached to this object ( calls delete on each object )
virtual void update(UpdateType _type=UPDATE_ALL)
This function is called to update the object.
picks edges (may not be implemented for all nodes)
virtual void setName(QString _name) override
path to the file from which the object is loaded ( defaults to "." )
PolyLine * line_
Pointer to the polyline.
picks faces (should be implemented for all nodes)
bool pickingEnabled()
Check if picking is enabled for this Object.
void setName(QString _name)
Set the name of the Object.
virtual ~PolyLineObject()
destructor
ACG::SceneGraph::PolyLineNodeT< PolyLine > * lineNode_
Scenegraph Mesh Node.
virtual void cleanup()
Reset current object, including all related nodes.
void set_line_width(float _sz)
set line width (default: 1.0)
ACG::PolyLineT< ACG::Vec3d > PolyLine
Simple Name for PolyLine.
void set_random_color()
Generates a random color and sets it.
QString getObjectinfo()
Get all Info for the Object as a string.
bool picked(uint _node_idx)
detect if the node has been picked
PickTarget
What target to use for picking.
virtual void cleanup() override
Point & point(unsigned int _i)
Get a point of the polyline.
picks verices (may not be implemented for all nodes)
QString name() const
return the name of the object. The name defaults to NONAME if unset.
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.
PolyLine * line()
return a pointer to the line
MaterialNode * materialNode()
get a pointer to the materialnode
void set_round_points(bool _b)
set round points enabled
virtual void init(PolyLine *_line=0)
Initialise current object, including all related nodes.
ACG::SceneGraph::PolyLineNodeT< PolyLine > * lineNode()
Get the scenegraph Node.
void enablePicking(bool _enable)
Enable or disable picking for this Object.
void setDataType(DataType _type)
PolyLineObject()
constructor
DataType dataType() const
void set_point_size(float _sz)
set point size (default: 1.0)