56 #define POLYLINEOBJECT_C
112 if (
line_ != NULL) {
116 std::cerr <<
"Destructor error : Line already deleted" << std::endl;
128 if (
line_ != NULL) {
132 std::cerr <<
"Cleanup error : Line already deleted" << std::endl;
164 line()->request_vertex_selections();
165 line()->request_edge_selections();
166 line()->request_vertex_vhandles();
167 line()->request_vertex_ehandles();
168 line()->request_vertex_fhandles();
172 std::cerr <<
"Error when creating Line Object! materialNode is NULL!" << std::endl;
194 std::string nodename = std::string(
"LineNode for Line " + _name.toUtf8() );
234 output +=
"========================================================================\n";
238 output +=
"Object Contains PolyLine : ";
240 output += QString::number(
line()->n_vertices() ) +
" vertices, ";
241 output += QString::number(
line()->n_edges() ) +=
" edges and is ";
242 if (
line()->is_closed() )
243 output +=
"closed.\n";
247 output +=
"========================================================================\n";
278 const unsigned int _targetIdx )
293 if(eh >= 0 && eh < (
int)
line()->n_edges())
311 if(vh>=0 && vh < (
int)
line()->n_vertices())
void enablePicking(bool _enable)
Enable or disable picking for this Object.
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.
PickTarget
What target to use for picking.
virtual QString getObjectinfo()
Get all Info for the Object as a string.
ACG::PolyLineT< ACG::Vec3d > PolyLine
Simple Name for PolyLine.
QString name() const
return the name of the object. The name defaults to NONAME if unset.
picks faces (should be implemented for all nodes)
void deleteData()
Delete all data attached to this object ( calls delete on each object )
void set_random_color()
Generates a random color and sets it.
virtual void setName(QString _name)
path to the file from which the object is loaded ( defaults to "." )
virtual void cleanup()
Reset current object, including all related nodes.
ACG::SceneGraph::PolyLineNodeT< PolyLine > * lineNode_
Scenegraph Mesh Node.
void setName(QString _name)
Set the name of the Object.
MaterialNode * materialNode()
get a pointer to the materialnode
DataType dataType() const
bool pickingEnabled()
Check if picking is enabled for this Object.
picks verices (may not be implemented for all nodes)
picks edges (may not be implemented for all nodes)
PolyLineObject()
constructor
bool picked(uint _node_idx)
detect if the node has been picked
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)
QString getObjectinfo()
Get all Info for the Object as a string.
virtual void update(UpdateType _type=UPDATE_ALL)
This function is called to update the object.
void set_line_width(float _sz)
set line width (default: 1.0)
void setDataType(DataType _type)
void set_round_points(bool _b)
set round points enabled
Point & point(unsigned int _i)
Get a point of the polyline.
ACG::SceneGraph::PolyLineNodeT< PolyLine > * lineNode()
Get the scenegraph Node.
PolyLine * line()
return a pointer to the line
PolyLine * line_
Pointer to the polyline.
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 ~PolyLineObject()
destructor