Commit 79f212b7 authored by Jan Möbius's avatar Jan Möbius

Cleanup hannes patch

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@17447 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 884064bb
This diff is collapsed.
......@@ -326,8 +326,7 @@ private:
ACG::Vec3d _n,
ACG::Vec3d* _pOut);
/*
* \brief Calculates common info.
/** \brief Calculates common info.
*
* Calculates common info like point on the mesh, point on the normal plane and the distance from the circle center
*
......@@ -354,8 +353,7 @@ private:
*/
ACG::Vec3d createCircle_getHit(PolyLineCircleData* _circleData, ACG::Vec3d _hit_point);
/*
* \brief Generates points for the ellipse.
/** \brief Generates points for the ellipse.
*
* @param _lineObject The object to generate points for.
* @param _pointCount The number of points to generate.
......@@ -363,15 +361,13 @@ private:
*/
void updatePolyEllipse(PolyLineObject* _lineObject, unsigned int _pointCount);
/*
* \brief Updates the center, forward and side handle of the Poly ellipse
/** \brief Updates the center, forward and side handle of the Poly ellipse
*
* @param _lineObject The object containing the handles.
*/
void updateHandles(PolyLineObject* _lineObject);
/*
* \brief Generates points for the spline, updates handles.
/** \brief Generates points for the spline, updates handles.
*
* @param _lineObject The object to generate points for.
* @param _pointCount The number of points to generate.
......@@ -379,15 +375,13 @@ private:
*/
void updatePolyBezierSpline(PolyLineObject* _lineObject, unsigned int _pointsPerSegment);
/*
* \brief Updates all the handles on the PolyBezier
/** \brief Updates all the handles on the PolyBezier
* @param _lineObject The object to update.
* @param _line the line node containing all the handles
*/
void updatePolyBezierHandles(PolyLineObject* _lineObject, ACG::SceneGraph::LineNode* _line);
/*
* \brief Returns the nearest point on the mesh or if none could be found the input.
/** \brief Returns the nearest point on the mesh or if none could be found the input.
*
* @param _SplineData The spline which is being used.
* @param _point The input point.
......@@ -400,21 +394,22 @@ private:
int createSpline_CurrSelIndex_;
/// Use this one to mark the last index to update the number of points
int createSpline_LastSelIndex_;
/// The handle which is being dragged.
ACG::SceneGraph::GlutPrimitiveNode* moveBezSpline_SelNode_;
/// The object which is being moved
int moveBezSpline_SelIndex_;
/// The index of the control or handle being moved
int moveBezSpline_SelSubIndex_;
int cur_merge_id_;
QTimer* smart_move_timer_;
PolyLineObject* cur_smart_move_obj_;
// Plane selection tool
QtPlaneSelect* planeSelect_;
/// The handle which is being dragged.
ACG::SceneGraph::GlutPrimitiveNode* moveBezSpline_SelNode_;
/// The object which is being moved
int moveBezSpline_SelIndex_;
/// The index of the control or handle being moved
int moveBezSpline_SelSubIndex_;
int cur_merge_id_;
QTimer* smart_move_timer_;
PolyLineObject* cur_smart_move_obj_;
/// Plane selection tool
QtPlaneSelect* planeSelect_;
};
......
......@@ -56,7 +56,7 @@ PolyLinePlugin::
getPointOnMesh(PolyLineBezierSplineData* _SplineData, ACG::Vec3d _point, ACG::Vec3d* _nor)
{
TriMeshObject* mesh;
if(!PluginFunctions::getObject(_SplineData->MeshIndex_, mesh))
if(!PluginFunctions::getObject(_SplineData->meshIndex(), mesh))
return _point;
OpenMeshTriangleBSPT<TriMesh>* bsp = mesh->requestTriangleBsp();
OpenMeshTriangleBSPT<TriMesh>::NearestNeighbor neigh = bsp->nearest(_point);
......@@ -77,18 +77,18 @@ updatePolyBezierHandles(PolyLineObject* _lineObject, ACG::SceneGraph::LineNode*
if(!splineData)
return;
_line->clear();
for(unsigned int i = 0; i < splineData->Handles_.size(); i++) {
for(unsigned int i = 0; i < splineData->handles_.size(); i++) {
ACG::SceneGraph::GlutPrimitiveNode* node = 0;
if(_lineObject->getAdditionalNode(node, name(), "handle", i))
node->set_position(splineData->Handles_[i]);
node->set_position(splineData->handles_[i]);
const PolyLineBezierSplineData::InterpolatePoint& control = splineData->getInterpolatePoint(i);
_line->add_line(control.Pos_, splineData->Handles_[i]);
_line->add_line(control.position, splineData->handles_[i]);
_line->add_color(ACG::Vec4f(1,0,0,1));
}
for(unsigned int i = 0; i < splineData->Points_.size(); i++) {
for(unsigned int i = 0; i < splineData->points_.size(); i++) {
ACG::SceneGraph::GlutPrimitiveNode* node = 0;
if(_lineObject->getAdditionalNode(node, name(), "control", i))
node->set_position(splineData->Points_[i].Pos_);
node->set_position(splineData->points_[i].position);
}
}
......@@ -100,10 +100,10 @@ updatePolyBezierSpline(PolyLineObject* _lineObject, unsigned int _pointCount)
if(!splineData)
return;
_lineObject->line()->clear();
int segCount = (splineData->Points_.size() + splineData->Handles_.size() - 1) / 3, segment = 0;
int segCount = (splineData->points_.size() + splineData->handles_.size() - 1) / 3, segment = 0;
for(int s = 0; s < segCount; s++) {
const ACG::Vec3d a = splineData->Points_[s].Pos_, d = splineData->Points_[s + 1].Pos_,
b = splineData->Handles_[s * 2], c = splineData->Handles_[s * 2 + 1];
const ACG::Vec3d a = splineData->points_[s].position, d = splineData->points_[s + 1].position,
b = splineData->handles_[s * 2], c = splineData->handles_[s * 2 + 1];
for(unsigned int i = 0; i < _pointCount; i++) {
float alpha = float(i) / float(_pointCount);
const ACG::Vec3d e = a + (b - a) * alpha, f = c + (d - c) * alpha;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment