59 #include "PolyLinePlugin.hh"
76 return _point + nor * rayInt[0].second;
77 return _point + nor.normalize() * neigh.dist;
88 for(
unsigned int i = 0; i < splineData->handles_.size(); i++) {
93 _line->
add_line(control.position, splineData->handles_[i]);
96 for(
unsigned int i = 0; i < splineData->points_.size(); i++) {
113 unsigned int segCount = (splineData->points_.size() + splineData->handles_.size() - 1) / 3;
114 for(
unsigned int s = 0; s < segCount; s++) {
115 const ACG::Vec3d a = splineData->points_[s].position, d = splineData->points_[s + 1].position,
116 b = splineData->handles_[s * 2], c = splineData->handles_[s * 2 + 1];
118 unsigned int n = (s != segCount - 1) ? _pointCount : (_pointCount + 1);
119 for(
unsigned int i = 0; i < n; i++) {
120 float alpha = float(i) / float(_pointCount);
121 const ACG::Vec3d e = a + (b - a) * alpha, f = c + (d - c) * alpha;
MeshT * mesh()
return a pointer to the mesh
const UpdateType UPDATE_GEOMETRY(UpdateTypeSet(1)<< 2)
Geometry updated.
PerObjectData * objectData(QString _dataName)
Returns the object data pointer.
std::vector< std::pair< Handle, Scalar > > RayCollision
Store nearest neighbor information.
Type for a MeshObject containing a triangle mesh.
bool getAdditionalNode(NodeT *&_node, QString _pluginName, QString _nodeName, int _id=0)
get an addition node from the object
bool getObject(int _identifier, BSplineCurveObject *&_object)
void updatePolyBezierHandles(PolyLineObject *_lineObject, ACG::SceneGraph::LineNode *_line)
Updates all the handles on the PolyBezier.
void clear()
Clear the current polyline.
OMTriangleBSP * requestTriangleBsp()
RayCollision raycollision(const Point &_p, const Point &_r) const
intersect mesh with ray
InterpolatePoint & getInterpolatePoint(unsigned int _handleIndex)
Retrieves the interpolate point based on the handle.
void clear()
clear points/lines and colors
void updatePolyBezierSpline(PolyLineObject *_lineObject, unsigned int _pointsPerSegment)
Generates points for the spline, updates handles.
const UpdateType UPDATE_TOPOLOGY(UpdateTypeSet(1)<< 3)
Topology updated.
NearestNeighbor nearest(const Point &_p) const
Return handle of the nearest neighbor face.
void add_point(const Point &_p)
Append a point to the polyline.
void add_line(const Vec3d &_v0, const Vec3d &_v1)
add line (for LineMode == LineSegmentsMode)
void set_position(const Vec3d &_p, int _idx=0)
set position
PolyLine * line()
return a pointer to the line
ACG::Vec3d getPointOnMesh(PolyLineBezierSplineData *_SplineData, ACG::Vec3d _point, ACG::Vec3d *_nor=0)
Returns the nearest point on the mesh or if none could be found the input.
QString name()
Name of the Plugin.
unsigned int meshIndex_
Index of the corresponding mesh.
void add_color(const ACG::Vec3uc &_c)
add color (only for LineMode == LineSegmentsMode)