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