Added StrokeAttribute class. Beginning of StrokeVertex.
IMPORTANT: The setters functions' names were normalized due to constant confusion regarding capitalization. All the function names start with set... instead of Set.... This convention was changed all throughout Freestyle. To use Freestyle as an external renderer, the SWIG library MUST be regenerated.
This commit is contained in:
@@ -68,11 +68,13 @@ python_sources = [
|
||||
prefix + '/IntegrationType.cpp',
|
||||
prefix + '/Interface0D.cpp',
|
||||
prefix + '/Interface0D/CurvePoint.cpp',
|
||||
# prefix + '/Interface0D/CurvePoint/StrokeVertex.cpp',
|
||||
prefix + '/Interface0D/SVertex.cpp',
|
||||
prefix + '/Interface0D/ViewVertex.cpp',
|
||||
prefix + '/Interface1D.cpp',
|
||||
prefix + '/Interface1D/FEdge.cpp',
|
||||
prefix + '/Nature.cpp',
|
||||
prefix + '/StrokeAttribute.cpp',
|
||||
prefix + '/UnaryFunction0D.cpp',
|
||||
prefix + '/UnaryFunction1D.cpp',
|
||||
prefix + '/UnaryPredicate0D.cpp',
|
||||
|
||||
@@ -68,7 +68,7 @@ AppCanvas::~AppCanvas()
|
||||
_pViewer = 0;
|
||||
}
|
||||
|
||||
void AppCanvas::SetViewer(AppGLWidget *iViewer)
|
||||
void AppCanvas::setViewer(AppGLWidget *iViewer)
|
||||
{
|
||||
_pViewer = iViewer;
|
||||
}
|
||||
@@ -181,7 +181,7 @@ void AppCanvas::readColorPixels(int x,int y,int w, int h, RGBImage& oImage) cons
|
||||
// qtmp.save("densityQuery"+QString::number(number)+".png", "PNG");
|
||||
//
|
||||
// GaussianFilter filter;
|
||||
// filter.SetSigma(4.0);
|
||||
// filter.setSigma(4.0);
|
||||
// int bound = filter.getBound();
|
||||
// QImage qtmp2(width(), height(), 32);
|
||||
// for(int py2=0;py2<height();++py2){
|
||||
@@ -246,7 +246,7 @@ void AppCanvas::Render(const StrokeRenderer *iRenderer)
|
||||
|
||||
glEnable(GL_LIGHTING);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
_pViewer->Set3DContext();
|
||||
_pViewer->set3DContext();
|
||||
_pViewer->DrawScene(_pViewer->glRenderer());
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
glDisable(GL_LIGHTING);
|
||||
@@ -347,7 +347,7 @@ void AppCanvas::RenderBasic(const StrokeRenderer *iRenderer)
|
||||
|
||||
glEnable(GL_LIGHTING);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
_pViewer->Set3DContext();
|
||||
_pViewer->set3DContext();
|
||||
_pViewer->DrawScene(_pViewer->glRenderer());
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
glDisable(GL_LIGHTING);
|
||||
|
||||
@@ -77,7 +77,7 @@ public:
|
||||
inline const AppGLWidget * viewer() const {return _pViewer;}
|
||||
|
||||
/*! modifiers */
|
||||
void SetViewer(AppGLWidget *iViewer) ;
|
||||
void setViewer(AppGLWidget *iViewer) ;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ AppDensityCurvesWindow::AppDensityCurvesWindow(QWidget *parent, const char *name
|
||||
AppDensityCurvesWindow::~AppDensityCurvesWindow(){
|
||||
}
|
||||
|
||||
void AppDensityCurvesWindow::SetOrientationCurve(int i, const Vec2d& vmin, const Vec2d& vmax, const vector<Vec3r>& iCurve, const char *xlabel, const char *ylabel){
|
||||
void AppDensityCurvesWindow::setOrientationCurve(int i, const Vec2d& vmin, const Vec2d& vmax, const vector<Vec3r>& iCurve, const char *xlabel, const char *ylabel){
|
||||
AppGL2DCurvesViewer * viewer = 0;
|
||||
switch(i){
|
||||
case 0:viewer = CurvesViewer0; break;
|
||||
@@ -44,10 +44,10 @@ void AppDensityCurvesWindow::SetOrientationCurve(int i, const Vec2d& vmin, const
|
||||
default:return;
|
||||
}
|
||||
|
||||
viewer->SetCurve(vmin, vmax, iCurve, xlabel, ylabel);
|
||||
viewer->setCurve(vmin, vmax, iCurve, xlabel, ylabel);
|
||||
}
|
||||
|
||||
void AppDensityCurvesWindow::SetLevelCurve(int i, const Vec2d& vmin, const Vec2d& vmax, const vector<Vec3r>& iCurve, const char *xlabel, const char *ylabel){
|
||||
void AppDensityCurvesWindow::setLevelCurve(int i, const Vec2d& vmin, const Vec2d& vmax, const vector<Vec3r>& iCurve, const char *xlabel, const char *ylabel){
|
||||
AppGL2DCurvesViewer * viewer = 0;
|
||||
switch(i){
|
||||
case 1:viewer = LevelCurveViewer1; break;
|
||||
@@ -61,5 +61,5 @@ void AppDensityCurvesWindow::SetLevelCurve(int i, const Vec2d& vmin, const Vec2d
|
||||
default:return;
|
||||
}
|
||||
|
||||
viewer->SetCurve(vmin, vmax, iCurve, xlabel, ylabel);
|
||||
viewer->setCurve(vmin, vmax, iCurve, xlabel, ylabel);
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ public:
|
||||
* \param ylabel
|
||||
* The label of the y-axis
|
||||
*/
|
||||
void SetOrientationCurve(int i, const Vec2d& vmin, const Vec2d& vmax, const vector<Vec3r>& iCurve, const char *xlabel, const char *ylabel);
|
||||
void setOrientationCurve(int i, const Vec2d& vmin, const Vec2d& vmax, const vector<Vec3r>& iCurve, const char *xlabel, const char *ylabel);
|
||||
|
||||
/*! Sets the node that contains the level curve i in
|
||||
* viewer i (i in [1,8]).
|
||||
@@ -77,7 +77,7 @@ public:
|
||||
* \param ylabel
|
||||
* The label of the y-axis
|
||||
*/
|
||||
void SetLevelCurve(int i, const Vec2d& vmin, const Vec2d& vmax, const vector<Vec3r>& iCurve, const char *xlabel, const char *ylabel);
|
||||
void setLevelCurve(int i, const Vec2d& vmin, const Vec2d& vmax, const vector<Vec3r>& iCurve, const char *xlabel, const char *ylabel);
|
||||
};
|
||||
|
||||
#endif // APPDENSITYCURVESWINDOW_H
|
||||
|
||||
@@ -28,8 +28,8 @@
|
||||
AppGL2DCurvesViewer::AppGL2DCurvesViewer(QWidget *iParent, const char *iName)
|
||||
: QGLViewer(iParent)
|
||||
{
|
||||
_RootNode.SetLightingEnabled(false);
|
||||
_RootNode.SetLineWidth(1.0);
|
||||
_RootNode.setLightingEnabled(false);
|
||||
_RootNode.setLineWidth(1.0);
|
||||
_pGLRenderer = new GLRenderer;
|
||||
}
|
||||
AppGL2DCurvesViewer::~AppGL2DCurvesViewer(){
|
||||
@@ -39,7 +39,7 @@ AppGL2DCurvesViewer::~AppGL2DCurvesViewer(){
|
||||
delete _pGLRenderer;
|
||||
}
|
||||
|
||||
void AppGL2DCurvesViewer::SetRange(const Vec2d& vmin, const Vec2d& vmax, const char * xlabel, const char *ylabel){
|
||||
void AppGL2DCurvesViewer::setRange(const Vec2d& vmin, const Vec2d& vmax, const char * xlabel, const char *ylabel){
|
||||
_vmin = vmin;
|
||||
_vmax = vmax;
|
||||
_xmargin = (vmax.x()-vmin.x())/20.0;
|
||||
@@ -53,8 +53,8 @@ void AppGL2DCurvesViewer::SetRange(const Vec2d& vmin, const Vec2d& vmax, const c
|
||||
if(ylabel)
|
||||
_ylabel = ylabel;
|
||||
}
|
||||
void AppGL2DCurvesViewer::SetCurve(const Vec2d& vmin, const Vec2d& vmax, const vector<Vec3r>& iPoints, const char *xlabel, const char *ylabel){
|
||||
SetRange(vmin, vmax, xlabel, ylabel);
|
||||
void AppGL2DCurvesViewer::setCurve(const Vec2d& vmin, const Vec2d& vmax, const vector<Vec3r>& iPoints, const char *xlabel, const char *ylabel){
|
||||
setRange(vmin, vmax, xlabel, ylabel);
|
||||
vector<Node*> nodes;
|
||||
_RootNode.RetrieveChildren(nodes);
|
||||
_RootNode.DetachChildren();
|
||||
@@ -67,7 +67,7 @@ void AppGL2DCurvesViewer::SetCurve(const Vec2d& vmin, const Vec2d& vmax, const v
|
||||
_curve = iPoints;
|
||||
NodeGroup * curveNode = new NodeGroup;
|
||||
NodeShape * shape = new NodeShape;
|
||||
shape->material().SetDiffuse(0,0,0,1);
|
||||
shape->material().setDiffuse(0,0,0,1);
|
||||
curveNode->AddChild(shape);
|
||||
shape->AddRep(new LineRep(iPoints));
|
||||
for(vector<Vec3r>::const_iterator v=iPoints.begin(), vend=iPoints.end();
|
||||
|
||||
@@ -46,8 +46,8 @@ public:
|
||||
|
||||
/*! Sets the ranges.
|
||||
*/
|
||||
void SetRange(const Vec2d& vmin, const Vec2d& vmax, const char * xlabel, const char *ylabel);
|
||||
void SetCurve(const Vec2d& vmin, const Vec2d& vmax, const vector<Vec3r>& iPoints, const char *xlabel, const char *ylabel);
|
||||
void setRange(const Vec2d& vmin, const Vec2d& vmax, const char * xlabel, const char *ylabel);
|
||||
void setCurve(const Vec2d& vmin, const Vec2d& vmax, const vector<Vec3r>& iPoints, const char *xlabel, const char *ylabel);
|
||||
void AddNode(Node* iNode);
|
||||
void DetachNode(Node* iNode);
|
||||
void RetrieveNodes(vector<Node*>& oNodes);
|
||||
|
||||
@@ -58,22 +58,22 @@ AppGLWidget::AppGLWidget(QWidget *iParent, const char *iName)
|
||||
_Fovy = 30.f;
|
||||
//_SceneDepth = 2.f;
|
||||
_RenderStyle = LINE;
|
||||
//_ModelRootNode->SetBBox(BBox<Vec3f>(Vec3f(-10.f, -10.f, -10.f), Vec3f(10.f, 10.f, 10.f)));
|
||||
//_ModelRootNode->setBBox(BBox<Vec3f>(Vec3f(-10.f, -10.f, -10.f), Vec3f(10.f, 10.f, 10.f)));
|
||||
_ModelRootNode = new NodeDrawingStyle;
|
||||
_SilhouetteRootNode = new NodeDrawingStyle;
|
||||
_DebugRootNode = new NodeDrawingStyle;
|
||||
|
||||
_RootNode.AddChild(_ModelRootNode);
|
||||
_SilhouetteRootNode->SetStyle(DrawingStyle::LINES);
|
||||
_SilhouetteRootNode->SetLightingEnabled(false);
|
||||
_SilhouetteRootNode->SetLineWidth(2.f);
|
||||
_SilhouetteRootNode->SetPointSize(3.f);
|
||||
_SilhouetteRootNode->setStyle(DrawingStyle::LINES);
|
||||
_SilhouetteRootNode->setLightingEnabled(false);
|
||||
_SilhouetteRootNode->setLineWidth(2.f);
|
||||
_SilhouetteRootNode->setPointSize(3.f);
|
||||
|
||||
_RootNode.AddChild(_SilhouetteRootNode);
|
||||
|
||||
_DebugRootNode->SetStyle(DrawingStyle::LINES);
|
||||
_DebugRootNode->SetLightingEnabled(false);
|
||||
_DebugRootNode->SetLineWidth(1.f);
|
||||
_DebugRootNode->setStyle(DrawingStyle::LINES);
|
||||
_DebugRootNode->setLightingEnabled(false);
|
||||
_DebugRootNode->setLineWidth(1.f);
|
||||
|
||||
_RootNode.AddChild(_DebugRootNode);
|
||||
|
||||
@@ -91,23 +91,23 @@ AppGLWidget::AppGLWidget(QWidget *iParent, const char *iName)
|
||||
|
||||
// 2D Scene
|
||||
// _pFENode = new NodeDrawingStyle;
|
||||
// _pFENode->SetStyle(DrawingStyle::LINES);
|
||||
// _pFENode->SetLightingEnabled(false);
|
||||
// _pFENode->SetLineWidth(1.f);
|
||||
// _pFENode->setStyle(DrawingStyle::LINES);
|
||||
// _pFENode->setLightingEnabled(false);
|
||||
// _pFENode->setLineWidth(1.f);
|
||||
//
|
||||
// _p2DNode.AddChild(_pFENode);
|
||||
//
|
||||
// _pVisibleSilhouetteNode = new NodeDrawingStyle;
|
||||
// _pVisibleSilhouetteNode->SetStyle(DrawingStyle::LINES);
|
||||
// _pVisibleSilhouetteNode->SetLightingEnabled(false);
|
||||
// _pVisibleSilhouetteNode->SetLineWidth(3.f);
|
||||
// _pVisibleSilhouetteNode->setStyle(DrawingStyle::LINES);
|
||||
// _pVisibleSilhouetteNode->setLightingEnabled(false);
|
||||
// _pVisibleSilhouetteNode->setLineWidth(3.f);
|
||||
//
|
||||
// _p2DNode.AddChild(_pVisibleSilhouetteNode);
|
||||
//
|
||||
_p2DSelectionNode = new NodeDrawingStyle;
|
||||
_p2DSelectionNode->SetLightingEnabled(false);
|
||||
_p2DSelectionNode->SetStyle(DrawingStyle::LINES);
|
||||
_p2DSelectionNode->SetLineWidth(5.f);
|
||||
_p2DSelectionNode->setLightingEnabled(false);
|
||||
_p2DSelectionNode->setStyle(DrawingStyle::LINES);
|
||||
_p2DSelectionNode->setLineWidth(5.f);
|
||||
|
||||
_p2DNode.AddChild(_p2DSelectionNode);
|
||||
|
||||
@@ -188,7 +188,7 @@ AppGLWidget::~AppGLWidget()
|
||||
//saveToFile(filename);
|
||||
}
|
||||
|
||||
void AppGLWidget::SetMainWindow(QMainWindow *iMainWindow) {
|
||||
void AppGLWidget::setMainWindow(QMainWindow *iMainWindow) {
|
||||
_pMainWindow = iMainWindow;
|
||||
}
|
||||
void AppGLWidget::captureMovie()
|
||||
@@ -315,18 +315,18 @@ AppGLWidget::select(const QMouseEvent *e) {
|
||||
_p2DSelectionNode->AddChild(g_pController->BuildRep(vedges.begin(), vedges.end()));
|
||||
// FEdge
|
||||
LineRep * fedgeRep = new LineRep(fe->vertexA()->point2d(), fe->vertexB()->point2d());
|
||||
fedgeRep->SetWidth(3.f);
|
||||
fedgeRep->setWidth(3.f);
|
||||
NodeShape * fedgeNode = new NodeShape;
|
||||
fedgeNode->AddRep(fedgeRep);
|
||||
fedgeNode->material().SetDiffuse(0.2, 1, 0.2, 1.0);
|
||||
fedgeNode->material().setDiffuse(0.2, 1, 0.2, 1.0);
|
||||
_p2DSelectionNode->AddChild(fedgeNode);
|
||||
//SVertex A
|
||||
Vec3r A(fe->vertexA()->point2d());
|
||||
VertexRep * aVertexRep = new VertexRep(A.x(), A.y(), A.z());
|
||||
aVertexRep->SetPointSize(3.f);
|
||||
aVertexRep->setPointSize(3.f);
|
||||
NodeShape * aVertexNode = new NodeShape;
|
||||
aVertexNode->AddRep(aVertexRep);
|
||||
aVertexNode->material().SetDiffuse(1, 0, 0, 1.0);
|
||||
aVertexNode->material().setDiffuse(1, 0, 0, 1.0);
|
||||
_p2DSelectionNode->AddChild(aVertexNode);
|
||||
// and its fedges
|
||||
const vector<FEdge*>& afedges = fe->vertexA()->fedges();
|
||||
@@ -336,16 +336,16 @@ AppGLWidget::select(const QMouseEvent *e) {
|
||||
++f)
|
||||
{
|
||||
LineRep * lrep = new LineRep((*f)->vertexA()->point2d(), (*f)->vertexB()->point2d());
|
||||
lrep->SetWidth(1.f);
|
||||
lrep->setWidth(1.f);
|
||||
aVertexNode->AddRep(lrep);
|
||||
}
|
||||
//SVertex B
|
||||
Vec3r B(fe->vertexB()->point2d());
|
||||
VertexRep * bVertexRep = new VertexRep(B.x(), B.y(), B.z());
|
||||
bVertexRep->SetPointSize(3.f);
|
||||
bVertexRep->setPointSize(3.f);
|
||||
NodeShape * bVertexNode = new NodeShape;
|
||||
bVertexNode->AddRep(bVertexRep);
|
||||
bVertexNode->material().SetDiffuse(0, 0, 1, 1.0);
|
||||
bVertexNode->material().setDiffuse(0, 0, 1, 1.0);
|
||||
_p2DSelectionNode->AddChild(bVertexNode);
|
||||
// and its fedges
|
||||
const vector<FEdge*>& bfedges = fe->vertexB()->fedges();
|
||||
@@ -356,7 +356,7 @@ AppGLWidget::select(const QMouseEvent *e) {
|
||||
++f)
|
||||
{
|
||||
LineRep * lrep = new LineRep((*f)->vertexA()->point2d(), (*f)->vertexB()->point2d());
|
||||
lrep->SetWidth(1.f);
|
||||
lrep->setWidth(1.f);
|
||||
bVertexNode->AddRep(lrep);
|
||||
}
|
||||
|
||||
@@ -458,9 +458,9 @@ AppGLWidget::keyPressEvent(QKeyEvent* e)
|
||||
}
|
||||
updateGL();
|
||||
break;
|
||||
case Qt::Key_1: _ModelRootNode->SetStyle(DrawingStyle::FILLED); updateGL(); break;
|
||||
case Qt::Key_2: _ModelRootNode->SetStyle(DrawingStyle::LINES); _ModelRootNode->SetLineWidth(1.0); updateGL(); break;
|
||||
case Qt::Key_3: _ModelRootNode->SetStyle(DrawingStyle::INVISIBLE); updateGL(); break;
|
||||
case Qt::Key_1: _ModelRootNode->setStyle(DrawingStyle::FILLED); updateGL(); break;
|
||||
case Qt::Key_2: _ModelRootNode->setStyle(DrawingStyle::LINES); _ModelRootNode->setLineWidth(1.0); updateGL(); break;
|
||||
case Qt::Key_3: _ModelRootNode->setStyle(DrawingStyle::INVISIBLE); updateGL(); break;
|
||||
case Qt::Key_B:
|
||||
{
|
||||
// if(e->state() == ShiftButton)
|
||||
@@ -737,7 +737,7 @@ void AppGLWidget::draw()
|
||||
|
||||
if (true == _Draw2DScene) {
|
||||
Draw2DScene(_pGLRenderer);
|
||||
Set3DContext();
|
||||
set3DContext();
|
||||
}
|
||||
if(_record){
|
||||
saveSnapshot(true);
|
||||
@@ -759,7 +759,7 @@ void AppGLWidget::DrawScene(SceneVisitor *iRenderer)
|
||||
|
||||
if(_drawEnvMap)
|
||||
{
|
||||
_ModelRootNode->SetLightingEnabled(false);
|
||||
_ModelRootNode->setLightingEnabled(false);
|
||||
glEnable(GL_COLOR_MATERIAL);
|
||||
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
@@ -800,15 +800,15 @@ void AppGLWidget::DrawScene(SceneVisitor *iRenderer)
|
||||
}
|
||||
|
||||
// FIXME
|
||||
// //_ModelRootNode->SetLightingEnabled(true);
|
||||
// //_ModelRootNode->setLightingEnabled(true);
|
||||
// if(_ModelRootNode->style() == DrawingStyle::LINES){
|
||||
// glPushAttrib(GL_ALL_ATTRIB_BITS);
|
||||
// //glDisable(GL_COLOR_MATERIAL);
|
||||
// _ModelRootNode->SetStyle(DrawingStyle::FILLED);
|
||||
// _ModelRootNode->SetLightingEnabled(true);
|
||||
// _ModelRootNode->setStyle(DrawingStyle::FILLED);
|
||||
// _ModelRootNode->setLightingEnabled(true);
|
||||
// _ModelRootNode->accept(*iRenderer);
|
||||
// _ModelRootNode->SetStyle(DrawingStyle::LINES);
|
||||
// _ModelRootNode->SetLightingEnabled(false);
|
||||
// _ModelRootNode->setStyle(DrawingStyle::LINES);
|
||||
// _ModelRootNode->setLightingEnabled(false);
|
||||
// _ModelRootNode->accept(*iRenderer);
|
||||
// glPopAttrib();
|
||||
// }
|
||||
@@ -819,7 +819,7 @@ void AppGLWidget::DrawScene(SceneVisitor *iRenderer)
|
||||
glDisable(GL_TEXTURE_GEN_T);
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
glDisable(GL_COLOR_MATERIAL);
|
||||
_ModelRootNode->SetLightingEnabled(true);
|
||||
_ModelRootNode->setLightingEnabled(true);
|
||||
|
||||
if(_fedges == true)
|
||||
_SilhouetteRootNode->accept(*iRenderer);
|
||||
|
||||
@@ -297,7 +297,7 @@ public:
|
||||
// when a model is added to the scene.
|
||||
void ReInitRenderers();
|
||||
|
||||
inline void SetSelectedFEdge(FEdge* iFEdge) { _pDebugRenderer->SetSelectedFEdge(iFEdge); }
|
||||
inline void SetSelectedFEdge(FEdge* iFEdge) { _pDebugRenderer->setSelectedFEdge(iFEdge); }
|
||||
|
||||
inline GLDebugRenderer* debugRenderer() { return _pDebugRenderer; }
|
||||
inline void toggle3D() { _Draw3DScene == true ? _Draw3DScene = false : _Draw3DScene = true; updateGL();}
|
||||
|
||||
@@ -40,7 +40,7 @@ AppMainWindow::AppMainWindow(QWidget *parent, const char *name, Qt::WindowFlags
|
||||
|
||||
// setCaption(Config::APPLICATION_NAME + " " + Config::APPLICATION_VERSION);
|
||||
setGeometry(20,20,700,700);
|
||||
pQGLWidget->SetMainWindow(this);
|
||||
pQGLWidget->setMainWindow(this);
|
||||
|
||||
_ProgressBar = new QProgressDialog(Config::APPLICATION_NAME + " Progress Dialog", "Cancel",
|
||||
0, 100, this);
|
||||
|
||||
@@ -194,7 +194,7 @@ void Controller::SetView(AppGLWidget *iView)
|
||||
|
||||
_pView = iView;
|
||||
//_pView2D->setGeometry(_pView->rect());
|
||||
_Canvas->SetViewer(_pView);
|
||||
_Canvas->setViewer(_pView);
|
||||
}
|
||||
|
||||
void Controller::SetMainWindow(AppMainWindow *iMainWindow)
|
||||
@@ -257,7 +257,7 @@ int Controller::Load3DSFile(const char *iFileName)
|
||||
_RootNode->AddChild(maxScene);
|
||||
_RootNode->UpdateBBox(); // FIXME: Correct that by making a Renderer to compute the bbox
|
||||
|
||||
_pView->SetModel(_RootNode);
|
||||
_pView->setModel(_RootNode);
|
||||
_pView->FitBBox();
|
||||
|
||||
_pMainWindow->DisplayMessage("Building Winged Edge structure");
|
||||
@@ -299,7 +299,7 @@ int Controller::Load3DSFile(const char *iFileName)
|
||||
|
||||
_ProgressBar->setProgress(3);
|
||||
|
||||
_pView->SetDebug(_DebugNode);
|
||||
_pView->setDebug(_DebugNode);
|
||||
|
||||
//delete stuff
|
||||
// if(0 != ws_builder)
|
||||
@@ -571,8 +571,8 @@ void Controller::LoadViewMapFile(const char *iFileName, bool only_camera)
|
||||
_pMainWindow->DisplayMessage("Updating display");
|
||||
ViewMapTesselator3D sTesselator3d;
|
||||
//ViewMapTesselator2D sTesselator2d;
|
||||
//sTesselator2d.SetNature(_edgeTesselationNature);
|
||||
sTesselator3d.SetNature(_edgeTesselationNature);
|
||||
//sTesselator2d.setNature(_edgeTesselationNature);
|
||||
sTesselator3d.setNature(_edgeTesselationNature);
|
||||
|
||||
// Tesselate the 3D edges:
|
||||
_SilhouetteNode = sTesselator3d.Tesselate(_ViewMap);
|
||||
@@ -653,7 +653,7 @@ void Controller::ComputeViewMap()
|
||||
// Restore the context of view:
|
||||
// we need to perform all these operations while the
|
||||
// 3D context is on.
|
||||
_pView->Set3DContext();
|
||||
_pView->set3DContext();
|
||||
float src[3] = { 0, 0, 0 };
|
||||
float vp_tmp[3];
|
||||
_pView->camera()->getWorldCoordinatesOf(src, vp_tmp);
|
||||
@@ -673,9 +673,9 @@ void Controller::ComputeViewMap()
|
||||
|
||||
_Chrono.start();
|
||||
if (_SceneNumFaces > 2000)
|
||||
edgeDetector.SetProgressBar(_ProgressBar);
|
||||
edgeDetector.setProgressBar(_ProgressBar);
|
||||
|
||||
edgeDetector.SetViewpoint(Vec3r(vp));
|
||||
edgeDetector.setViewpoint(Vec3r(vp));
|
||||
edgeDetector.enableRidgesAndValleysFlag(_ComputeRidges);
|
||||
edgeDetector.enableSuggestiveContours(_ComputeSuggestive);
|
||||
edgeDetector.setSphereRadius(_sphereRadius);
|
||||
@@ -758,7 +758,7 @@ void Controller::ComputeViewMap()
|
||||
// if((res == GeomUtils::DO_INTERSECT) && (t>=0.0) && (t<=1.0)){
|
||||
// Vec3r inter(oppositeEdge->GetaVertex()->GetVertex() + t*v1v2);
|
||||
// VertexRep * irep = new VertexRep(inter.x(), inter.y(), inter.z());
|
||||
// irep->SetPointSize(5.0);
|
||||
// irep->setPointSize(5.0);
|
||||
// silhouetteDebugShape->AddRep(irep);
|
||||
// }
|
||||
// }
|
||||
@@ -789,9 +789,9 @@ void Controller::ComputeViewMap()
|
||||
// silhouetteDebugShape->AddRep(line);
|
||||
// }
|
||||
// Material redmat;
|
||||
// redmat.SetDiffuse(1,0,0,1);
|
||||
// redmat.setDiffuse(1,0,0,1);
|
||||
// Material greenmat;
|
||||
// greenmat.SetDiffuse(0,1,0,1);
|
||||
// greenmat.setDiffuse(0,1,0,1);
|
||||
// real vecSize = _bboxDiag/70.0;
|
||||
// vector<WXFaceLayer*> flayers;
|
||||
// wxf->retrieveSmoothLayers(Nature::RIDGE, flayers);
|
||||
@@ -831,17 +831,17 @@ void Controller::ComputeViewMap()
|
||||
// Curvature_info * ci = fci->vec_curvature_info[i];
|
||||
// Vec3r v(wxf->GetVertex(i)->GetVertex());
|
||||
// // VertexRep *vrep = new VertexRep(v[0], v[1], v[2]);
|
||||
// // vrep->SetMaterial(redmat);
|
||||
// // vrep->SetPointSize(5.0);
|
||||
// // vrep->setMaterial(redmat);
|
||||
// // vrep->setPointSize(5.0);
|
||||
// // silhouetteDebugShape->AddRep(vrep);
|
||||
// // LineRep * maxc = new LineRep(v-vecSize*ci->e1/2.0, v+vecSize*ci->e1/2.0);
|
||||
// // LineRep * maxc = new LineRep(v, v+vecSize*ci->e1);
|
||||
// // maxc->SetMaterial(redmat);
|
||||
// // maxc->SetWidth(2.0);
|
||||
// // maxc->setMaterial(redmat);
|
||||
// // maxc->setWidth(2.0);
|
||||
// // silhouetteDebugShape->AddRep(maxc);
|
||||
// LineRep * minc = new LineRep(v, v+vecSize*ci->e2);
|
||||
// minc->SetMaterial(greenmat);
|
||||
// minc->SetWidth(2.0);
|
||||
// minc->setMaterial(greenmat);
|
||||
// minc->setWidth(2.0);
|
||||
// silhouetteDebugShape->AddRep(minc);
|
||||
// }
|
||||
// }
|
||||
@@ -888,21 +888,21 @@ void Controller::ComputeViewMap()
|
||||
// Builds the view map structure from the flagged WSEdge structure:
|
||||
//----------------------------------------------------------
|
||||
ViewMapBuilder vmBuilder;
|
||||
vmBuilder.SetProgressBar(_ProgressBar);
|
||||
vmBuilder.SetEnableQI(_EnableQI);
|
||||
vmBuilder.SetViewpoint(Vec3r(vp));
|
||||
vmBuilder.setProgressBar(_ProgressBar);
|
||||
vmBuilder.setEnableQI(_EnableQI);
|
||||
vmBuilder.setViewpoint(Vec3r(vp));
|
||||
|
||||
vmBuilder.SetTransform(mv, proj, viewport, focalLength, _pView->GetAspect(), _pView->GetFovyRadian());
|
||||
vmBuilder.SetFrustum(_pView->znear(), _pView->zfar());
|
||||
vmBuilder.setTransform(mv, proj, viewport, focalLength, _pView->GetAspect(), _pView->GetFovyRadian());
|
||||
vmBuilder.setFrustum(_pView->znear(), _pView->zfar());
|
||||
|
||||
vmBuilder.SetGrid(&_Grid);
|
||||
vmBuilder.setGrid(&_Grid);
|
||||
|
||||
// Builds a tesselated form of the silhouette for display purpose:
|
||||
//---------------------------------------------------------------
|
||||
ViewMapTesselator3D sTesselator3d;
|
||||
//ViewMapTesselator2D sTesselator2d;
|
||||
//sTesselator2d.SetNature(_edgeTesselationNature);
|
||||
sTesselator3d.SetNature(_edgeTesselationNature);
|
||||
//sTesselator2d.setNature(_edgeTesselationNature);
|
||||
sTesselator3d.setNature(_edgeTesselationNature);
|
||||
|
||||
_Chrono.start();
|
||||
// Build View Map
|
||||
@@ -1016,10 +1016,10 @@ void Controller::ComputeViewMap()
|
||||
// positive = true;
|
||||
// }
|
||||
// if(positive)
|
||||
// mat.SetDiffuse(1,1,0,1);
|
||||
// mat.setDiffuse(1,1,0,1);
|
||||
// else
|
||||
// mat.SetDiffuse(1,0,0,1);
|
||||
// lrep->SetMaterial(mat);
|
||||
// mat.setDiffuse(1,0,0,1);
|
||||
// lrep->setMaterial(mat);
|
||||
// fe = fe->nextEdge();
|
||||
// }while((fe!=0) && (fe!=fefirst));
|
||||
// }
|
||||
@@ -1060,7 +1060,7 @@ void Controller::ComputeSteerableViewMap(){
|
||||
ng[i] = new NodeGroup;
|
||||
}
|
||||
NodeShape *completeNS = new NodeShape;
|
||||
completeNS->material().SetDiffuse(c,c,c,1);
|
||||
completeNS->material().setDiffuse(c,c,c,1);
|
||||
ng[Canvas::NB_STEERABLE_VIEWMAP-1]->AddChild(completeNS);
|
||||
SteerableViewMap * svm = _Canvas->getSteerableViewMap();
|
||||
svm->Reset();
|
||||
@@ -1082,7 +1082,7 @@ void Controller::ComputeSteerableViewMap(){
|
||||
double wc = oweights[i]*c;
|
||||
if(oweights[i] == 0)
|
||||
continue;
|
||||
ns->material().SetDiffuse(wc, wc, wc, 1);
|
||||
ns->material().setDiffuse(wc, wc, wc, 1);
|
||||
ns->AddRep(fRep);
|
||||
ng[i]->AddChild(ns);
|
||||
}
|
||||
@@ -1318,7 +1318,7 @@ void Controller::SwapStyleModules(unsigned i1, unsigned i2)
|
||||
|
||||
void Controller::toggleLayer(unsigned index, bool iDisplay)
|
||||
{
|
||||
_Canvas->SetVisible(index, iDisplay);
|
||||
_Canvas->setVisible(index, iDisplay);
|
||||
_pView->updateGL();
|
||||
}
|
||||
|
||||
@@ -1371,8 +1371,8 @@ FEdge* Controller::SelectFEdge(real x, real y)
|
||||
|
||||
FEdge *fedge = (FEdge*)_ViewMap->GetClosestFEdge(x,y);
|
||||
ViewEdge *selection = fedge->viewedge();
|
||||
_pView->SetSelectedFEdge(fedge);
|
||||
_Canvas->SetSelectedFEdge(fedge);
|
||||
_pView->setSelectedFEdge(fedge);
|
||||
_Canvas->setSelectedFEdge(fedge);
|
||||
return fedge;
|
||||
}
|
||||
|
||||
@@ -1383,8 +1383,8 @@ ViewEdge* Controller::SelectViewEdge(real x, real y)
|
||||
|
||||
FEdge *fedge = (FEdge*)_ViewMap->GetClosestFEdge(x,y);
|
||||
ViewEdge *selection = fedge->viewedge();
|
||||
_pView->SetSelectedFEdge(fedge);
|
||||
_Canvas->SetSelectedFEdge(fedge);
|
||||
_pView->setSelectedFEdge(fedge);
|
||||
_Canvas->setSelectedFEdge(fedge);
|
||||
return selection;
|
||||
}
|
||||
|
||||
@@ -1393,8 +1393,8 @@ NodeGroup * Controller::BuildRep(vector<ViewEdge*>::iterator vedges_begin,
|
||||
{
|
||||
ViewMapTesselator2D tesselator2D;
|
||||
Material mat;
|
||||
mat.SetDiffuse(1,1,0.3,1);
|
||||
tesselator2D.SetMaterial(mat);
|
||||
mat.setDiffuse(1,1,0.3,1);
|
||||
tesselator2D.setMaterial(mat);
|
||||
|
||||
return (tesselator2D.Tesselate(vedges_begin, vedges_end));
|
||||
}
|
||||
@@ -1491,8 +1491,8 @@ void Controller::displayDensityCurves(int x, int y){
|
||||
|
||||
// display the curves
|
||||
for(i=0; i<nbCurves; ++i)
|
||||
_pDensityCurvesWindow->SetOrientationCurve(i, Vec2d(0,0), Vec2d(nbPoints, 1), curves[i], "scale", "density");
|
||||
_pDensityCurvesWindow->setOrientationCurve(i, Vec2d(0,0), Vec2d(nbPoints, 1), curves[i], "scale", "density");
|
||||
for(i=1; i<=8; ++i)
|
||||
_pDensityCurvesWindow->SetLevelCurve(i, Vec2d(0,0), Vec2d(nbCurves, 1), curvesDirection[i], "orientation", "density");
|
||||
_pDensityCurvesWindow->setLevelCurve(i, Vec2d(0,0), Vec2d(nbCurves, 1), curvesDirection[i], "orientation", "density");
|
||||
_pDensityCurvesWindow->show();
|
||||
}
|
||||
|
||||
@@ -44,8 +44,8 @@ int main(int argc, char** argv)
|
||||
//app->setMainWidget(mainWindow); // QT3
|
||||
|
||||
g_pController = new Controller;
|
||||
g_pController->SetMainWindow(&mainWindow);
|
||||
g_pController->SetView(mainWindow.pQGLWidget);
|
||||
g_pController->setMainWindow(&mainWindow);
|
||||
g_pController->setView(mainWindow.pQGLWidget);
|
||||
|
||||
mainWindow.show();
|
||||
|
||||
|
||||
@@ -37,8 +37,8 @@ QGLBasicWidget::QGLBasicWidget( QWidget* parent, const char* name, int w, int h,
|
||||
// _Pbuffer->create(false);
|
||||
// #endif
|
||||
resizeGL(w,h);
|
||||
_RootNode.SetLightingEnabled(false);
|
||||
_RootNode.SetLineWidth(1.0);
|
||||
_RootNode.setLightingEnabled(false);
|
||||
_RootNode.setLineWidth(1.0);
|
||||
}
|
||||
|
||||
QGLBasicWidget::QGLBasicWidget( const QGLFormat& format, QWidget* parent, const char* name,
|
||||
@@ -54,8 +54,8 @@ QGLBasicWidget::QGLBasicWidget( const QGLFormat& format, QWidget* parent, const
|
||||
// _Pbuffer->create(false);
|
||||
// #endif
|
||||
resizeGL(w,h);
|
||||
_RootNode.SetLightingEnabled(false);
|
||||
_RootNode.SetLineWidth(1.0);
|
||||
_RootNode.setLightingEnabled(false);
|
||||
_RootNode.setLineWidth(1.0);
|
||||
}
|
||||
|
||||
QGLBasicWidget::~QGLBasicWidget()
|
||||
|
||||
@@ -69,7 +69,7 @@ AppCanvas::~AppCanvas()
|
||||
_pViewer = 0;
|
||||
}
|
||||
|
||||
void AppCanvas::SetViewer(AppGLWidget *iViewer)
|
||||
void AppCanvas::setViewer(AppGLWidget *iViewer)
|
||||
{
|
||||
_pViewer = iViewer;
|
||||
}
|
||||
@@ -182,7 +182,7 @@ void AppCanvas::readColorPixels(int x,int y,int w, int h, RGBImage& oImage) cons
|
||||
// qtmp.save("densityQuery"+QString::number(number)+".png", "PNG");
|
||||
//
|
||||
// GaussianFilter filter;
|
||||
// filter.SetSigma(4.0);
|
||||
// filter.setSigma(4.0);
|
||||
// int bound = filter.getBound();
|
||||
// QImage qtmp2(width(), height(), 32);
|
||||
// for(int py2=0;py2<height();++py2){
|
||||
@@ -247,7 +247,7 @@ void AppCanvas::Render(const StrokeRenderer *iRenderer)
|
||||
|
||||
glEnable(GL_LIGHTING);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
_pViewer->Set3DContext();
|
||||
_pViewer->set3DContext();
|
||||
_pViewer->DrawScene(_pViewer->glRenderer());
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
glDisable(GL_LIGHTING);
|
||||
@@ -349,7 +349,7 @@ void AppCanvas::RenderBasic(const StrokeRenderer *iRenderer)
|
||||
|
||||
glEnable(GL_LIGHTING);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
_pViewer->Set3DContext();
|
||||
_pViewer->set3DContext();
|
||||
_pViewer->DrawScene(_pViewer->glRenderer());
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
glDisable(GL_LIGHTING);
|
||||
|
||||
@@ -48,7 +48,7 @@ public:
|
||||
inline const AppGLWidget * viewer() const {return _pViewer;}
|
||||
|
||||
/*! modifiers */
|
||||
void SetViewer(AppGLWidget *iViewer) ;
|
||||
void setViewer(AppGLWidget *iViewer) ;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -63,22 +63,22 @@ AppGLWidget::AppGLWidget(const char *iName)
|
||||
_Fovy = 30.f;
|
||||
//_SceneDepth = 2.f;
|
||||
_RenderStyle = LINE;
|
||||
//_ModelRootNode->SetBBox(BBox<Vec3f>(Vec3f(-10.f, -10.f, -10.f), Vec3f(10.f, 10.f, 10.f)));
|
||||
//_ModelRootNode->setBBox(BBox<Vec3f>(Vec3f(-10.f, -10.f, -10.f), Vec3f(10.f, 10.f, 10.f)));
|
||||
_ModelRootNode = new NodeDrawingStyle;
|
||||
_SilhouetteRootNode = new NodeDrawingStyle;
|
||||
_DebugRootNode = new NodeDrawingStyle;
|
||||
|
||||
_RootNode.AddChild(_ModelRootNode);
|
||||
_SilhouetteRootNode->SetStyle(DrawingStyle::LINES);
|
||||
_SilhouetteRootNode->SetLightingEnabled(false);
|
||||
_SilhouetteRootNode->SetLineWidth(2.f);
|
||||
_SilhouetteRootNode->SetPointSize(3.f);
|
||||
_SilhouetteRootNode->setStyle(DrawingStyle::LINES);
|
||||
_SilhouetteRootNode->setLightingEnabled(false);
|
||||
_SilhouetteRootNode->setLineWidth(2.f);
|
||||
_SilhouetteRootNode->setPointSize(3.f);
|
||||
|
||||
_RootNode.AddChild(_SilhouetteRootNode);
|
||||
|
||||
_DebugRootNode->SetStyle(DrawingStyle::LINES);
|
||||
_DebugRootNode->SetLightingEnabled(false);
|
||||
_DebugRootNode->SetLineWidth(1.f);
|
||||
_DebugRootNode->setStyle(DrawingStyle::LINES);
|
||||
_DebugRootNode->setLightingEnabled(false);
|
||||
_DebugRootNode->setLineWidth(1.f);
|
||||
|
||||
_RootNode.AddChild(_DebugRootNode);
|
||||
|
||||
@@ -96,23 +96,23 @@ AppGLWidget::AppGLWidget(const char *iName)
|
||||
|
||||
// 2D Scene
|
||||
// _pFENode = new NodeDrawingStyle;
|
||||
// _pFENode->SetStyle(DrawingStyle::LINES);
|
||||
// _pFENode->SetLightingEnabled(false);
|
||||
// _pFENode->SetLineWidth(1.f);
|
||||
// _pFENode->setStyle(DrawingStyle::LINES);
|
||||
// _pFENode->setLightingEnabled(false);
|
||||
// _pFENode->setLineWidth(1.f);
|
||||
//
|
||||
// _p2DNode.AddChild(_pFENode);
|
||||
//
|
||||
// _pVisibleSilhouetteNode = new NodeDrawingStyle;
|
||||
// _pVisibleSilhouetteNode->SetStyle(DrawingStyle::LINES);
|
||||
// _pVisibleSilhouetteNode->SetLightingEnabled(false);
|
||||
// _pVisibleSilhouetteNode->SetLineWidth(3.f);
|
||||
// _pVisibleSilhouetteNode->setStyle(DrawingStyle::LINES);
|
||||
// _pVisibleSilhouetteNode->setLightingEnabled(false);
|
||||
// _pVisibleSilhouetteNode->setLineWidth(3.f);
|
||||
//
|
||||
// _p2DNode.AddChild(_pVisibleSilhouetteNode);
|
||||
//
|
||||
_p2DSelectionNode = new NodeDrawingStyle;
|
||||
_p2DSelectionNode->SetLightingEnabled(false);
|
||||
_p2DSelectionNode->SetStyle(DrawingStyle::LINES);
|
||||
_p2DSelectionNode->SetLineWidth(5.f);
|
||||
_p2DSelectionNode->setLightingEnabled(false);
|
||||
_p2DSelectionNode->setStyle(DrawingStyle::LINES);
|
||||
_p2DSelectionNode->setLineWidth(5.f);
|
||||
|
||||
_p2DNode.AddChild(_p2DSelectionNode);
|
||||
|
||||
@@ -315,7 +315,7 @@ void AppGLWidget::draw()
|
||||
|
||||
if (true == _Draw2DScene) {
|
||||
Draw2DScene(_pGLRenderer);
|
||||
Set3DContext();
|
||||
set3DContext();
|
||||
}
|
||||
if(_record){
|
||||
saveSnapshot(true);
|
||||
@@ -328,7 +328,7 @@ void AppGLWidget::DrawScene(SceneVisitor *iRenderer)
|
||||
|
||||
if(_drawEnvMap)
|
||||
{
|
||||
_ModelRootNode->SetLightingEnabled(false);
|
||||
_ModelRootNode->setLightingEnabled(false);
|
||||
glEnable(GL_COLOR_MATERIAL);
|
||||
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
@@ -369,15 +369,15 @@ void AppGLWidget::DrawScene(SceneVisitor *iRenderer)
|
||||
}
|
||||
|
||||
// FIXME
|
||||
// //_ModelRootNode->SetLightingEnabled(true);
|
||||
// //_ModelRootNode->setLightingEnabled(true);
|
||||
// if(_ModelRootNode->style() == DrawingStyle::LINES){
|
||||
// glPushAttrib(GL_ALL_ATTRIB_BITS);
|
||||
// //glDisable(GL_COLOR_MATERIAL);
|
||||
// _ModelRootNode->SetStyle(DrawingStyle::FILLED);
|
||||
// _ModelRootNode->SetLightingEnabled(true);
|
||||
// _ModelRootNode->setStyle(DrawingStyle::FILLED);
|
||||
// _ModelRootNode->setLightingEnabled(true);
|
||||
// _ModelRootNode->accept(*iRenderer);
|
||||
// _ModelRootNode->SetStyle(DrawingStyle::LINES);
|
||||
// _ModelRootNode->SetLightingEnabled(false);
|
||||
// _ModelRootNode->setStyle(DrawingStyle::LINES);
|
||||
// _ModelRootNode->setLightingEnabled(false);
|
||||
// _ModelRootNode->accept(*iRenderer);
|
||||
// glPopAttrib();
|
||||
// }
|
||||
@@ -388,7 +388,7 @@ void AppGLWidget::DrawScene(SceneVisitor *iRenderer)
|
||||
glDisable(GL_TEXTURE_GEN_T);
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
glDisable(GL_COLOR_MATERIAL);
|
||||
_ModelRootNode->SetLightingEnabled(true);
|
||||
_ModelRootNode->setLightingEnabled(true);
|
||||
|
||||
if(_fedges == true)
|
||||
_SilhouetteRootNode->accept(*iRenderer);
|
||||
|
||||
@@ -110,7 +110,7 @@ public:
|
||||
LINES : line rendering
|
||||
DEPTHBUFFER : grey-levels rendering of the depth buffer
|
||||
*/
|
||||
inline void SetRenderStyle(RenderStyle iStyle)
|
||||
inline void setRenderStyle(RenderStyle iStyle)
|
||||
{
|
||||
_RenderStyle = iStyle;
|
||||
}
|
||||
@@ -119,7 +119,7 @@ public:
|
||||
* iModel
|
||||
* The Root Node of the model
|
||||
*/
|
||||
inline void SetModel(NodeGroup *iModel)
|
||||
inline void setModel(NodeGroup *iModel)
|
||||
{
|
||||
if(0 != _ModelRootNode->numberOfChildren())
|
||||
{
|
||||
@@ -173,7 +173,7 @@ public:
|
||||
updateGL();
|
||||
}
|
||||
|
||||
inline void SetDebug(NodeGroup* iDebug)
|
||||
inline void setDebug(NodeGroup* iDebug)
|
||||
{
|
||||
if(0 != _DebugRootNode->numberOfChildren())
|
||||
{
|
||||
@@ -240,9 +240,9 @@ public:
|
||||
updateGL();
|
||||
}
|
||||
|
||||
void SetMainWindow(QMainWindow *iMainWindow) ;
|
||||
void setMainWindow(QMainWindow *iMainWindow) ;
|
||||
|
||||
inline void Set3DContext()
|
||||
inline void set3DContext()
|
||||
{
|
||||
// GL_PROJECTION matrix
|
||||
_camera->loadProjectionMatrix();
|
||||
@@ -323,7 +323,7 @@ public:
|
||||
// when a model is added to the scene.
|
||||
void ReInitRenderers();
|
||||
|
||||
inline void SetSelectedFEdge(FEdge* iFEdge) { _pDebugRenderer->SetSelectedFEdge(iFEdge); }
|
||||
inline void setSelectedFEdge(FEdge* iFEdge) { _pDebugRenderer->setSelectedFEdge(iFEdge); }
|
||||
|
||||
inline GLDebugRenderer* debugRenderer() { return _pDebugRenderer; }
|
||||
inline void toggle3D() { _Draw3DScene == true ? _Draw3DScene = false : _Draw3DScene = true; updateGL();}
|
||||
|
||||
@@ -159,13 +159,13 @@ Controller::~Controller()
|
||||
//delete _current_dirs;
|
||||
}
|
||||
|
||||
void Controller::SetView(AppGLWidget *iView)
|
||||
void Controller::setView(AppGLWidget *iView)
|
||||
{
|
||||
if(NULL == iView)
|
||||
return;
|
||||
|
||||
_pView = iView;
|
||||
_Canvas->SetViewer(_pView);
|
||||
_Canvas->setViewer(_pView);
|
||||
}
|
||||
|
||||
|
||||
@@ -208,7 +208,7 @@ int Controller::Load3DSFile(const char *iFileName)
|
||||
_RootNode->AddChild(maxScene);
|
||||
_RootNode->UpdateBBox(); // FIXME: Correct that by making a Renderer to compute the bbox
|
||||
|
||||
_pView->SetModel(_RootNode);
|
||||
_pView->setModel(_RootNode);
|
||||
//_pView->FitBBox();
|
||||
|
||||
|
||||
@@ -245,7 +245,7 @@ int Controller::Load3DSFile(const char *iFileName)
|
||||
// DEBUG
|
||||
// _Grid.displayDebug();
|
||||
|
||||
_pView->SetDebug(_DebugNode);
|
||||
_pView->setDebug(_DebugNode);
|
||||
|
||||
//delete stuff
|
||||
// if(0 != ws_builder)
|
||||
@@ -273,7 +273,7 @@ int Controller::Load3DSFile(const char *iFileName)
|
||||
|
||||
void Controller::CloseFile()
|
||||
{
|
||||
WShape::SetCurrentId(0);
|
||||
WShape::setCurrentId(0);
|
||||
_pView->DetachModel();
|
||||
_ListOfModels.clear();
|
||||
if(NULL != _RootNode)
|
||||
@@ -460,7 +460,7 @@ void Controller::SaveViewMapFile(const char *oFileName)
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // Set the camera position
|
||||
// // set the camera position
|
||||
// float position[3];
|
||||
// float orientation[4];
|
||||
// ifs.read((char*)position, 3 * sizeof(*position));
|
||||
@@ -514,8 +514,8 @@ void Controller::SaveViewMapFile(const char *oFileName)
|
||||
// // Update display
|
||||
// ViewMapTesselator3D sTesselator3d;
|
||||
// //ViewMapTesselator2D sTesselator2d;
|
||||
// //sTesselator2d.SetNature(_edgeTesselationNature);
|
||||
// sTesselator3d.SetNature(_edgeTesselationNature);
|
||||
// //sTesselator2d.setNature(_edgeTesselationNature);
|
||||
// sTesselator3d.setNature(_edgeTesselationNature);
|
||||
//
|
||||
// // Tesselate the 3D edges:
|
||||
// _SilhouetteNode = sTesselator3d.Tesselate(_ViewMap);
|
||||
@@ -596,7 +596,7 @@ void Controller::ComputeViewMap()
|
||||
// Restore the context of view:
|
||||
// we need to perform all these operations while the
|
||||
// 3D context is on.
|
||||
_pView->Set3DContext();
|
||||
_pView->set3DContext();
|
||||
float src[3] = { 0, 0, 0 };
|
||||
float vp_tmp[3] = { 0, 0, 0 };
|
||||
_pView->_camera->getWorldCoordinatesOf(src, vp_tmp);
|
||||
@@ -616,7 +616,7 @@ void Controller::ComputeViewMap()
|
||||
|
||||
_Chrono.start();
|
||||
|
||||
edgeDetector.SetViewpoint(Vec3r(vp));
|
||||
edgeDetector.setViewpoint(Vec3r(vp));
|
||||
edgeDetector.enableRidgesAndValleysFlag(_ComputeRidges);
|
||||
edgeDetector.enableSuggestiveContours(_ComputeSuggestive);
|
||||
edgeDetector.setSphereRadius(_sphereRadius);
|
||||
@@ -629,20 +629,20 @@ void Controller::ComputeViewMap()
|
||||
// Builds the view map structure from the flagged WSEdge structure:
|
||||
//----------------------------------------------------------
|
||||
ViewMapBuilder vmBuilder;
|
||||
vmBuilder.SetEnableQI(_EnableQI);
|
||||
vmBuilder.SetViewpoint(Vec3r(vp));
|
||||
vmBuilder.setEnableQI(_EnableQI);
|
||||
vmBuilder.setViewpoint(Vec3r(vp));
|
||||
|
||||
vmBuilder.SetTransform(mv, proj, viewport, focalLength, _pView->GetAspect(), _pView->GetFovyRadian());
|
||||
vmBuilder.SetFrustum(_pView->znear(), _pView->zfar());
|
||||
vmBuilder.setTransform(mv, proj, viewport, focalLength, _pView->GetAspect(), _pView->GetFovyRadian());
|
||||
vmBuilder.setFrustum(_pView->znear(), _pView->zfar());
|
||||
|
||||
vmBuilder.SetGrid(&_Grid);
|
||||
vmBuilder.setGrid(&_Grid);
|
||||
|
||||
// Builds a tesselated form of the silhouette for display purpose:
|
||||
//---------------------------------------------------------------
|
||||
ViewMapTesselator3D sTesselator3d;
|
||||
//ViewMapTesselator2D sTesselator2d;
|
||||
//sTesselator2d.SetNature(_edgeTesselationNature);
|
||||
sTesselator3d.SetNature(_edgeTesselationNature);
|
||||
//sTesselator2d.setNature(_edgeTesselationNature);
|
||||
sTesselator3d.setNature(_edgeTesselationNature);
|
||||
|
||||
_Chrono.start();
|
||||
// Build View Map
|
||||
@@ -689,7 +689,7 @@ void Controller::ComputeSteerableViewMap(){
|
||||
// ng[i] = new NodeGroup;
|
||||
// }
|
||||
// NodeShape *completeNS = new NodeShape;
|
||||
// completeNS->material().SetDiffuse(c,c,c,1);
|
||||
// completeNS->material().setDiffuse(c,c,c,1);
|
||||
// ng[Canvas::NB_STEERABLE_VIEWMAP-1]->AddChild(completeNS);
|
||||
// SteerableViewMap * svm = _Canvas->getSteerableViewMap();
|
||||
// svm->Reset();
|
||||
@@ -710,7 +710,7 @@ void Controller::ComputeSteerableViewMap(){
|
||||
// double wc = oweights[i]*c;
|
||||
// if(oweights[i] == 0)
|
||||
// continue;
|
||||
// ns->material().SetDiffuse(wc, wc, wc, 1);
|
||||
// ns->material().setDiffuse(wc, wc, wc, 1);
|
||||
// ns->AddRep(fRep);
|
||||
// ng[i]->AddChild(ns);
|
||||
// }
|
||||
@@ -895,7 +895,7 @@ void Controller::SwapStyleModules(unsigned i1, unsigned i2)
|
||||
|
||||
void Controller::toggleLayer(unsigned index, bool iDisplay)
|
||||
{
|
||||
_Canvas->SetVisible(index, iDisplay);
|
||||
_Canvas->setVisible(index, iDisplay);
|
||||
_pView->updateGL();
|
||||
}
|
||||
|
||||
@@ -932,8 +932,8 @@ FEdge* Controller::SelectFEdge(real x, real y)
|
||||
|
||||
FEdge *fedge = (FEdge*)_ViewMap->GetClosestFEdge(x,y);
|
||||
//ViewEdge *selection = fedge->viewedge();
|
||||
_pView->SetSelectedFEdge(fedge);
|
||||
_Canvas->SetSelectedFEdge(fedge);
|
||||
_pView->setSelectedFEdge(fedge);
|
||||
_Canvas->setSelectedFEdge(fedge);
|
||||
return fedge;
|
||||
}
|
||||
|
||||
@@ -944,8 +944,8 @@ ViewEdge* Controller::SelectViewEdge(real x, real y)
|
||||
|
||||
FEdge *fedge = (FEdge*)_ViewMap->GetClosestFEdge(x,y);
|
||||
ViewEdge *selection = fedge->viewedge();
|
||||
_pView->SetSelectedFEdge(fedge);
|
||||
_Canvas->SetSelectedFEdge(fedge);
|
||||
_pView->setSelectedFEdge(fedge);
|
||||
_Canvas->setSelectedFEdge(fedge);
|
||||
return selection;
|
||||
}
|
||||
|
||||
@@ -954,8 +954,8 @@ NodeGroup * Controller::BuildRep(vector<ViewEdge*>::iterator vedges_begin,
|
||||
{
|
||||
ViewMapTesselator2D tesselator2D;
|
||||
Material mat;
|
||||
mat.SetDiffuse(1,1,0.3,1);
|
||||
tesselator2D.SetMaterial(mat);
|
||||
mat.setDiffuse(1,1,0.3,1);
|
||||
tesselator2D.setMaterial(mat);
|
||||
|
||||
return (tesselator2D.Tesselate(vedges_begin, vedges_end));
|
||||
}
|
||||
@@ -1049,9 +1049,9 @@ void Controller::displayDensityCurves(int x, int y){
|
||||
|
||||
// display the curves
|
||||
// for(i=0; i<nbCurves; ++i)
|
||||
// _pDensityCurvesWindow->SetOrientationCurve(i, Vec2d(0,0), Vec2d(nbPoints, 1), curves[i], "scale", "density");
|
||||
// _pDensityCurvesWindow->setOrientationCurve(i, Vec2d(0,0), Vec2d(nbPoints, 1), curves[i], "scale", "density");
|
||||
// for(i=1; i<=8; ++i)
|
||||
// _pDensityCurvesWindow->SetLevelCurve(i, Vec2d(0,0), Vec2d(nbCurves, 1), curvesDirection[i], "orientation", "density");
|
||||
// _pDensityCurvesWindow->setLevelCurve(i, Vec2d(0,0), Vec2d(nbCurves, 1), curvesDirection[i], "orientation", "density");
|
||||
// _pDensityCurvesWindow->show();
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ public:
|
||||
Controller() ;
|
||||
~Controller() ;
|
||||
|
||||
void SetView(AppGLWidget *iView);
|
||||
void setView(AppGLWidget *iView);
|
||||
|
||||
//soc
|
||||
void init_options();
|
||||
|
||||
@@ -42,7 +42,7 @@ extern "C" {
|
||||
if( view == NULL )
|
||||
view = new AppGLWidget;
|
||||
|
||||
controller->SetView(view);
|
||||
controller->setView(view);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -189,8 +189,8 @@ public:
|
||||
inline real z() {return _Vector[2];}
|
||||
|
||||
/*! modifiers */
|
||||
inline void SetVector(const Vec3r& iVector) {_Vector = iVector;}
|
||||
inline void SetIndex(unsigned iIndex) {_index = iIndex;}
|
||||
inline void setVector(const Vec3r& iVector) {_Vector = iVector;}
|
||||
inline void setIndex(unsigned iIndex) {_index = iIndex;}
|
||||
|
||||
/*! operators */
|
||||
IndexedVertex& operator=(const IndexedVertex& iv)
|
||||
|
||||
@@ -69,7 +69,7 @@ int GaussianFilter::computeMaskSize(float sigma)
|
||||
return maskSize;
|
||||
}
|
||||
|
||||
void GaussianFilter::SetSigma(float sigma)
|
||||
void GaussianFilter::setSigma(float sigma)
|
||||
{
|
||||
_sigma = sigma;
|
||||
computeMask();
|
||||
|
||||
@@ -82,7 +82,7 @@ public:
|
||||
inline int getBound() {return _bound;}
|
||||
|
||||
/*! modifiers */
|
||||
void SetSigma(float sigma) ;
|
||||
void setSigma(float sigma) ;
|
||||
// void SetMaskSize(int size) {_maskSize = size;_storedMaskSize=(_maskSize+1)>>1;}
|
||||
|
||||
|
||||
|
||||
@@ -13,8 +13,7 @@ extern "C" {
|
||||
|
||||
extern PyTypeObject BinaryPredicate0D_Type;
|
||||
|
||||
#define BPy_BinaryPredicate0D_Check(v) \
|
||||
((v)->ob_type == &BinaryPredicate0D_Type)
|
||||
#define BPy_BinaryPredicate0D_Check(v) (( (PyObject *) v)->ob_type == &BinaryPredicate0D_Type)
|
||||
|
||||
/*---------------------------Python BPy_BinaryPredicate0D structure definition----------*/
|
||||
typedef struct {
|
||||
|
||||
@@ -13,8 +13,7 @@ extern "C" {
|
||||
|
||||
extern PyTypeObject BinaryPredicate1D_Type;
|
||||
|
||||
#define BPy_BinaryPredicate1D_Check(v) \
|
||||
((v)->ob_type == &BinaryPredicate1D_Type)
|
||||
#define BPy_BinaryPredicate1D_Check(v) (( (PyObject *) v)->ob_type == &BinaryPredicate1D_Type)
|
||||
|
||||
/*---------------------------Python BPy_BinaryPredicate1D structure definition----------*/
|
||||
typedef struct {
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "Interface0D/CurvePoint.h"
|
||||
#include "Interface1D.h"
|
||||
#include "Nature.h"
|
||||
#include "StrokeAttribute.h"
|
||||
#include "UnaryFunction0D.h"
|
||||
#include "UnaryFunction1D.h"
|
||||
#include "UnaryPredicate0D.h"
|
||||
@@ -134,6 +135,7 @@ PyObject *Freestyle_Init( void )
|
||||
Interface0D_Init( module );
|
||||
Interface1D_Init( module );
|
||||
Nature_Init( module );
|
||||
StrokeAttribute_Init( module );
|
||||
UnaryFunction0D_Init( module );
|
||||
UnaryFunction1D_Init( module );
|
||||
UnaryPredicate0D_Init( module );
|
||||
|
||||
@@ -11,8 +11,7 @@ extern "C" {
|
||||
|
||||
extern PyTypeObject Freestyle_Type;
|
||||
|
||||
#define BPy_Freestyle_Check(v) \
|
||||
((v)->ob_type == &Freestyle_Type)
|
||||
#define BPy_Freestyle_Check(v) (( (PyObject *) v)->ob_type == &Freestyle_Type)
|
||||
|
||||
/*---------------------------Python BPy_Freestyle structure definition----------*/
|
||||
typedef struct {
|
||||
|
||||
@@ -16,8 +16,7 @@ extern "C" {
|
||||
|
||||
extern PyTypeObject Id_Type;
|
||||
|
||||
#define BPy_Id_Check(v) \
|
||||
((v)->ob_type == &Id_Type)
|
||||
#define BPy_Id_Check(v) (( (PyObject *) v)->ob_type == &Id_Type)
|
||||
|
||||
/*---------------------------Python BPy_Id structure definition----------*/
|
||||
typedef struct {
|
||||
|
||||
@@ -13,8 +13,7 @@ extern "C" {
|
||||
|
||||
extern PyTypeObject IntegrationType_Type;
|
||||
|
||||
#define BPy_IntegrationType_Check(v) \
|
||||
((v)->ob_type == &IntegrationType_Type)
|
||||
#define BPy_IntegrationType_Check(v) (( (PyObject *) v)->ob_type == &IntegrationType_Type)
|
||||
|
||||
/*---------------------------Python BPy_IntegrationType structure definition----------*/
|
||||
typedef struct {
|
||||
|
||||
@@ -13,8 +13,7 @@ extern "C" {
|
||||
|
||||
extern PyTypeObject Interface0D_Type;
|
||||
|
||||
#define BPy_Interface0D_Check(v) \
|
||||
((v)->ob_type == &Interface0D_Type)
|
||||
#define BPy_Interface0D_Check(v) (( (PyObject *) v)->ob_type == &Interface0D_Type)
|
||||
|
||||
/*---------------------------Python BPy_Interface0D structure definition----------*/
|
||||
typedef struct {
|
||||
|
||||
@@ -14,9 +14,9 @@ static PyObject * CurvePoint___copy__( BPy_CurvePoint *self );
|
||||
static PyObject * CurvePoint_A( BPy_CurvePoint *self );
|
||||
static PyObject * CurvePoint_B( BPy_CurvePoint *self );
|
||||
static PyObject * CurvePoint_t2d( BPy_CurvePoint *self );
|
||||
static PyObject *CurvePoint_SetA( BPy_CurvePoint *self , PyObject *args);
|
||||
static PyObject *CurvePoint_SetB( BPy_CurvePoint *self , PyObject *args);
|
||||
static PyObject *CurvePoint_SetT2d( BPy_CurvePoint *self , PyObject *args);
|
||||
static PyObject *CurvePoint_setA( BPy_CurvePoint *self , PyObject *args);
|
||||
static PyObject *CurvePoint_setB( BPy_CurvePoint *self , PyObject *args);
|
||||
static PyObject *CurvePoint_setT2d( BPy_CurvePoint *self , PyObject *args);
|
||||
static PyObject *CurvePoint_curvatureFredo( BPy_CurvePoint *self , PyObject *args);
|
||||
|
||||
/*----------------------CurvePoint instance definitions ----------------------------*/
|
||||
@@ -25,9 +25,9 @@ static PyMethodDef BPy_CurvePoint_methods[] = {
|
||||
{"A", ( PyCFunction ) CurvePoint_A, METH_NOARGS, "( )Returns the first SVertex upon which the CurvePoint is built."},
|
||||
{"B", ( PyCFunction ) CurvePoint_B, METH_NOARGS, "( )Returns the second SVertex upon which the CurvePoint is built."},
|
||||
{"t2d", ( PyCFunction ) CurvePoint_t2d, METH_NOARGS, "( )Returns the interpolation parameter."},
|
||||
{"SetA", ( PyCFunction ) CurvePoint_SetA, METH_VARARGS, "(SVertex sv )Sets the first SVertex upon which to build the CurvePoint."},
|
||||
{"SetB", ( PyCFunction ) CurvePoint_SetB, METH_VARARGS, "(SVertex sv )Sets the second SVertex upon which to build the CurvePoint."},
|
||||
{"SetT2d", ( PyCFunction ) CurvePoint_SetT2d, METH_VARARGS, "( )Sets the 2D interpolation parameter to use."},
|
||||
{"setA", ( PyCFunction ) CurvePoint_setA, METH_VARARGS, "(SVertex sv )Sets the first SVertex upon which to build the CurvePoint."},
|
||||
{"setB", ( PyCFunction ) CurvePoint_setB, METH_VARARGS, "(SVertex sv )Sets the second SVertex upon which to build the CurvePoint."},
|
||||
{"setT2d", ( PyCFunction ) CurvePoint_setT2d, METH_VARARGS, "( )Sets the 2D interpolation parameter to use."},
|
||||
{"curvatureFredo", ( PyCFunction ) CurvePoint_curvatureFredo, METH_NOARGS, "( )angle in radians."},
|
||||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
@@ -182,41 +182,41 @@ PyObject * CurvePoint_t2d( BPy_CurvePoint *self ) {
|
||||
return PyFloat_FromDouble( self->cp->t2d() );
|
||||
}
|
||||
|
||||
PyObject *CurvePoint_SetA( BPy_CurvePoint *self , PyObject *args) {
|
||||
PyObject *CurvePoint_setA( BPy_CurvePoint *self , PyObject *args) {
|
||||
PyObject *py_sv;
|
||||
|
||||
if(!( PyArg_ParseTuple(args, "O", &py_sv) && BPy_SVertex_Check(py_sv) )) {
|
||||
cout << "ERROR: CurvePoint_SetA" << endl;
|
||||
cout << "ERROR: CurvePoint_setA" << endl;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
self->cp->SetA( ((BPy_SVertex *) py_sv)->sv );
|
||||
self->cp->setA( ((BPy_SVertex *) py_sv)->sv );
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
PyObject *CurvePoint_SetB( BPy_CurvePoint *self , PyObject *args) {
|
||||
PyObject *CurvePoint_setB( BPy_CurvePoint *self , PyObject *args) {
|
||||
PyObject *py_sv;
|
||||
|
||||
if(!( PyArg_ParseTuple(args, "O", &py_sv) && BPy_SVertex_Check(py_sv) )) {
|
||||
cout << "ERROR: CurvePoint_SetB" << endl;
|
||||
cout << "ERROR: CurvePoint_setB" << endl;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
self->cp->SetB( ((BPy_SVertex *) py_sv)->sv );
|
||||
self->cp->setB( ((BPy_SVertex *) py_sv)->sv );
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
PyObject *CurvePoint_SetT2d( BPy_CurvePoint *self , PyObject *args) {
|
||||
PyObject *CurvePoint_setT2d( BPy_CurvePoint *self , PyObject *args) {
|
||||
float t;
|
||||
|
||||
if( !PyArg_ParseTuple(args, "f", &t) ) {
|
||||
cout << "ERROR: CurvePoint_SetT2d" << endl;
|
||||
cout << "ERROR: CurvePoint_setT2d" << endl;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
self->cp->SetT2d( t );
|
||||
self->cp->setT2d( t );
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
@@ -14,8 +14,7 @@ extern "C" {
|
||||
|
||||
extern PyTypeObject CurvePoint_Type;
|
||||
|
||||
#define BPy_CurvePoint_Check(v) \
|
||||
((v)->ob_type == &CurvePoint_Type)
|
||||
#define BPy_CurvePoint_Check(v) (( (PyObject *) v)->ob_type == &CurvePoint_Type)
|
||||
|
||||
/*---------------------------Python BPy_CurvePoint structure definition----------*/
|
||||
typedef struct {
|
||||
|
||||
@@ -1,104 +1,254 @@
|
||||
PyObject *_wrap_StrokeVertex_getExactTypeName(PyObject *self , PyObject *args) {
|
||||
#include "StrokeVertex.h"
|
||||
|
||||
#include "../../Convert.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*--------------- Python API function prototypes for StrokeVertex instance -----------*/
|
||||
static int StrokeVertex___init__(BPy_StrokeVertex *self, PyObject *args, PyObject *kwds);
|
||||
|
||||
|
||||
/*----------------------StrokeVertex instance definitions ----------------------------*/
|
||||
static PyMethodDef BPy_StrokeVertex_methods[] = {
|
||||
// {"__copy__", ( PyCFunction ) StrokeVertex___copy__, METH_NOARGS, "( )Cloning method."},
|
||||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
/*-----------------------BPy_StrokeVertex type definition ------------------------------*/
|
||||
|
||||
PyTypeObject StrokeVertex_Type = {
|
||||
PyObject_HEAD_INIT( NULL )
|
||||
0, /* ob_size */
|
||||
"StrokeVertex", /* tp_name */
|
||||
sizeof( BPy_StrokeVertex ), /* tp_basicsize */
|
||||
0, /* tp_itemsize */
|
||||
|
||||
/* methods */
|
||||
NULL, /* tp_dealloc */
|
||||
NULL, /* printfunc tp_print; */
|
||||
NULL, /* getattrfunc tp_getattr; */
|
||||
NULL, /* setattrfunc tp_setattr; */
|
||||
NULL, /* tp_compare */
|
||||
NULL, /* tp_repr */
|
||||
|
||||
/* Method suites for standard classes */
|
||||
|
||||
NULL, /* PyNumberMethods *tp_as_number; */
|
||||
NULL, /* PySequenceMethods *tp_as_sequence; */
|
||||
NULL, /* PyMappingMethods *tp_as_mapping; */
|
||||
|
||||
/* More standard operations (here for binary compatibility) */
|
||||
|
||||
NULL, /* hashfunc tp_hash; */
|
||||
NULL, /* ternaryfunc tp_call; */
|
||||
NULL, /* reprfunc tp_str; */
|
||||
NULL, /* getattrofunc tp_getattro; */
|
||||
NULL, /* setattrofunc tp_setattro; */
|
||||
|
||||
/* Functions to access object as input/output buffer */
|
||||
NULL, /* PyBufferProcs *tp_as_buffer; */
|
||||
|
||||
/*** Flags to define presence of optional/expanded features ***/
|
||||
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */
|
||||
|
||||
NULL, /* char *tp_doc; Documentation string */
|
||||
/*** Assigned meaning in release 2.0 ***/
|
||||
/* call function for all accessible objects */
|
||||
NULL, /* traverseproc tp_traverse; */
|
||||
|
||||
/* delete references to contained objects */
|
||||
NULL, /* inquiry tp_clear; */
|
||||
|
||||
/*** Assigned meaning in release 2.1 ***/
|
||||
/*** rich comparisons ***/
|
||||
NULL, /* richcmpfunc tp_richcompare; */
|
||||
|
||||
/*** weak reference enabler ***/
|
||||
0, /* long tp_weaklistoffset; */
|
||||
|
||||
/*** Added in release 2.2 ***/
|
||||
/* Iterators */
|
||||
NULL, /* getiterfunc tp_iter; */
|
||||
NULL, /* iternextfunc tp_iternext; */
|
||||
|
||||
/*** Attribute descriptor and subclassing stuff ***/
|
||||
BPy_StrokeVertex_methods, /* struct PyMethodDef *tp_methods; */
|
||||
NULL, /* struct PyMemberDef *tp_members; */
|
||||
NULL, /* struct PyGetSetDef *tp_getset; */
|
||||
&Interface0D_Type, /* struct _typeobject *tp_base; */
|
||||
NULL, /* PyObject *tp_dict; */
|
||||
NULL, /* descrgetfunc tp_descr_get; */
|
||||
NULL, /* descrsetfunc tp_descr_set; */
|
||||
0, /* long tp_dictoffset; */
|
||||
(initproc)StrokeVertex___init__, /* initproc tp_init; */
|
||||
NULL, /* allocfunc tp_alloc; */
|
||||
NULL, /* newfunc tp_new; */
|
||||
|
||||
/* Low-level free-memory routine */
|
||||
NULL, /* freefunc tp_free; */
|
||||
|
||||
/* For PyObject_IS_GC */
|
||||
NULL, /* inquiry tp_is_gc; */
|
||||
NULL, /* PyObject *tp_bases; */
|
||||
|
||||
/* method resolution order */
|
||||
NULL, /* PyObject *tp_mro; */
|
||||
NULL, /* PyObject *tp_cache; */
|
||||
NULL, /* PyObject *tp_subclasses; */
|
||||
NULL, /* PyObject *tp_weaklist; */
|
||||
NULL
|
||||
};
|
||||
|
||||
//-------------------MODULE INITIALIZATION--------------------------------
|
||||
|
||||
|
||||
//------------------------INSTANCE METHODS ----------------------------------
|
||||
|
||||
int StrokeVertex___init__(BPy_StrokeVertex *self, PyObject *args, PyObject *kwds)
|
||||
{
|
||||
|
||||
PyObject *obj1 = 0, *obj2 = 0 , *obj3 = 0;
|
||||
|
||||
if (! PyArg_ParseTuple(args, "|OOO", &obj1, &obj2, &obj3) )
|
||||
return -1;
|
||||
|
||||
if( !obj1 && !obj2 && !obj3 ){
|
||||
self->cp = new CurvePoint();
|
||||
} else if( PyFloat_Check(obj3) ) {
|
||||
if( BPy_SVertex_Check(obj1) && BPy_SVertex_Check(obj2) ) {
|
||||
self->cp = new CurvePoint( ((BPy_SVertex *) obj1)->sv,
|
||||
((BPy_SVertex *) obj2)->sv,
|
||||
PyFloat_AsDouble( obj3 ) );
|
||||
} else if( BPy_CurvePoint_Check(obj1) && BPy_CurvePoint_Check(obj2) ) {
|
||||
self->cp = new CurvePoint( ((BPy_CurvePoint *) obj1)->cp,
|
||||
((BPy_CurvePoint *) obj2)->cp,
|
||||
PyFloat_AsDouble( obj3 ) );
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
|
||||
self->py_if0D.if0D = self->cp;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
PyObject *_wrap_new_StrokeVertex__SWIG_0(PyObject *self , PyObject *args) {
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
PyObject *_wrap_new_StrokeVertex__SWIG_1(PyObject *self , PyObject *args) {
|
||||
}
|
||||
|
||||
|
||||
PyObject *_wrap_new_StrokeVertex__SWIG_2(PyObject *self , PyObject *args) {
|
||||
}
|
||||
|
||||
|
||||
PyObject *_wrap_new_StrokeVertex__SWIG_3(PyObject *self , PyObject *args) {
|
||||
}
|
||||
|
||||
|
||||
PyObject *_wrap_new_StrokeVertex__SWIG_4(PyObject *self , PyObject *args) {
|
||||
}
|
||||
|
||||
|
||||
PyObject *_wrap_new_StrokeVertex__SWIG_5(PyObject *self , PyObject *args) {
|
||||
}
|
||||
|
||||
|
||||
PyObject *_wrap_new_StrokeVertex(PyObject *self, PyObject *args) {
|
||||
}
|
||||
|
||||
|
||||
PyObject *_wrap_delete_StrokeVertex(PyObject *self , PyObject *args) {
|
||||
}
|
||||
|
||||
|
||||
PyObject *_wrap_StrokeVertex_x(PyObject *self , PyObject *args) {
|
||||
}
|
||||
|
||||
|
||||
PyObject *_wrap_StrokeVertex_y(PyObject *self , PyObject *args) {
|
||||
}
|
||||
|
||||
|
||||
PyObject *_wrap_StrokeVertex_getPoint(PyObject *self , PyObject *args) {
|
||||
}
|
||||
|
||||
|
||||
PyObject *_wrap_StrokeVertex_attribute__SWIG_0(PyObject *self , PyObject *args) {
|
||||
}
|
||||
|
||||
|
||||
PyObject *_wrap_StrokeVertex_attribute__SWIG_1(PyObject *self , PyObject *args) {
|
||||
}
|
||||
|
||||
|
||||
PyObject *_wrap_StrokeVertex_attribute(PyObject *self, PyObject *args) {
|
||||
}
|
||||
|
||||
|
||||
PyObject *_wrap_StrokeVertex_curvilinearAbscissa(PyObject *self , PyObject *args) {
|
||||
}
|
||||
|
||||
|
||||
PyObject *_wrap_StrokeVertex_strokeLength(PyObject *self , PyObject *args) {
|
||||
}
|
||||
|
||||
|
||||
PyObject *_wrap_StrokeVertex_u(PyObject *self , PyObject *args) {
|
||||
}
|
||||
|
||||
|
||||
PyObject *_wrap_StrokeVertex_SetX(PyObject *self , PyObject *args) {
|
||||
}
|
||||
|
||||
|
||||
PyObject *_wrap_StrokeVertex_SetY(PyObject *self , PyObject *args) {
|
||||
}
|
||||
|
||||
|
||||
PyObject *_wrap_StrokeVertex_SetPoint__SWIG_0(PyObject *self , PyObject *args) {
|
||||
}
|
||||
|
||||
|
||||
PyObject *_wrap_StrokeVertex_SetPoint__SWIG_1(PyObject *self , PyObject *args) {
|
||||
}
|
||||
|
||||
|
||||
PyObject *_wrap_StrokeVertex_SetPoint(PyObject *self, PyObject *args) {
|
||||
}
|
||||
|
||||
|
||||
PyObject *_wrap_StrokeVertex_SetAttribute(PyObject *self , PyObject *args) {
|
||||
}
|
||||
|
||||
|
||||
PyObject *_wrap_StrokeVertex_SetCurvilinearAbscissa(PyObject *self , PyObject *args) {
|
||||
}
|
||||
|
||||
|
||||
PyObject *_wrap_StrokeVertex_SetStrokeLength(PyObject *self , PyObject *args) {
|
||||
}
|
||||
|
||||
// PyObject *_wrap_StrokeVertex_getExactTypeName(PyObject *self , PyObject *args) {
|
||||
// }
|
||||
//
|
||||
//
|
||||
// PyObject *_wrap_new_StrokeVertex__SWIG_0(PyObject *self , PyObject *args) {
|
||||
// }
|
||||
//
|
||||
//
|
||||
// PyObject *_wrap_new_StrokeVertex__SWIG_1(PyObject *self , PyObject *args) {
|
||||
// }
|
||||
//
|
||||
//
|
||||
// PyObject *_wrap_new_StrokeVertex__SWIG_2(PyObject *self , PyObject *args) {
|
||||
// }
|
||||
//
|
||||
//
|
||||
// PyObject *_wrap_new_StrokeVertex__SWIG_3(PyObject *self , PyObject *args) {
|
||||
// }
|
||||
//
|
||||
//
|
||||
// PyObject *_wrap_new_StrokeVertex__SWIG_4(PyObject *self , PyObject *args) {
|
||||
// }
|
||||
//
|
||||
//
|
||||
// PyObject *_wrap_new_StrokeVertex__SWIG_5(PyObject *self , PyObject *args) {
|
||||
// }
|
||||
//
|
||||
//
|
||||
// PyObject *_wrap_new_StrokeVertex(PyObject *self, PyObject *args) {
|
||||
// }
|
||||
//
|
||||
//
|
||||
// PyObject *_wrap_delete_StrokeVertex(PyObject *self , PyObject *args) {
|
||||
// }
|
||||
//
|
||||
//
|
||||
// PyObject *_wrap_StrokeVertex_x(PyObject *self , PyObject *args) {
|
||||
// }
|
||||
//
|
||||
//
|
||||
// PyObject *_wrap_StrokeVertex_y(PyObject *self , PyObject *args) {
|
||||
// }
|
||||
//
|
||||
//
|
||||
// PyObject *_wrap_StrokeVertex_getPoint(PyObject *self , PyObject *args) {
|
||||
// }
|
||||
//
|
||||
//
|
||||
// PyObject *_wrap_StrokeVertex_attribute__SWIG_0(PyObject *self , PyObject *args) {
|
||||
// }
|
||||
//
|
||||
//
|
||||
// PyObject *_wrap_StrokeVertex_attribute__SWIG_1(PyObject *self , PyObject *args) {
|
||||
// }
|
||||
//
|
||||
//
|
||||
// PyObject *_wrap_StrokeVertex_attribute(PyObject *self, PyObject *args) {
|
||||
// }
|
||||
//
|
||||
//
|
||||
// PyObject *_wrap_StrokeVertex_curvilinearAbscissa(PyObject *self , PyObject *args) {
|
||||
// }
|
||||
//
|
||||
//
|
||||
// PyObject *_wrap_StrokeVertex_strokeLength(PyObject *self , PyObject *args) {
|
||||
// }
|
||||
//
|
||||
//
|
||||
// PyObject *_wrap_StrokeVertex_u(PyObject *self , PyObject *args) {
|
||||
// }
|
||||
//
|
||||
//
|
||||
// PyObject *_wrap_StrokeVertex_SetX(PyObject *self , PyObject *args) {
|
||||
// }
|
||||
//
|
||||
//
|
||||
// PyObject *_wrap_StrokeVertex_SetY(PyObject *self , PyObject *args) {
|
||||
// }
|
||||
//
|
||||
//
|
||||
// PyObject *_wrap_StrokeVertex_SetPoint__SWIG_0(PyObject *self , PyObject *args) {
|
||||
// }
|
||||
//
|
||||
//
|
||||
// PyObject *_wrap_StrokeVertex_SetPoint__SWIG_1(PyObject *self , PyObject *args) {
|
||||
// }
|
||||
//
|
||||
//
|
||||
// PyObject *_wrap_StrokeVertex_SetPoint(PyObject *self, PyObject *args) {
|
||||
// }
|
||||
//
|
||||
//
|
||||
// PyObject *_wrap_StrokeVertex_SetAttribute(PyObject *self , PyObject *args) {
|
||||
// }
|
||||
//
|
||||
//
|
||||
// PyObject *_wrap_StrokeVertex_SetCurvilinearAbscissa(PyObject *self , PyObject *args) {
|
||||
// }
|
||||
//
|
||||
//
|
||||
// PyObject *_wrap_StrokeVertex_SetStrokeLength(PyObject *self , PyObject *args) {
|
||||
// }
|
||||
//
|
||||
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
#ifndef FREESTYLE_PYTHON_STROKEVERTEX_H
|
||||
#define FREESTYLE_PYTHON_STROKEVERTEX_H
|
||||
|
||||
#include "../CurvePoint.h"
|
||||
#include "../../stroke/Stroke.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <Python.h>
|
||||
|
||||
extern PyTypeObject StrokeVertex_Type;
|
||||
|
||||
#define BPy_StrokeVertex_Check(v) (( (PyObject *) v)->ob_type == &StrokeVertex_Type)
|
||||
|
||||
/*---------------------------Python BPy_StrokeVertex structure definition----------*/
|
||||
typedef struct {
|
||||
BPy_CurvePoint py_cp;
|
||||
StrokeVertex *sv;
|
||||
} BPy_StrokeVertex;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* FREESTYLE_PYTHON_STROKEVERTEX_H */
|
||||
@@ -14,10 +14,10 @@ static int SVertex___init__(BPy_SVertex *self, PyObject *args, PyObject *kwds);
|
||||
static PyObject * SVertex___copy__( BPy_SVertex *self );
|
||||
static PyObject * SVertex_normals( BPy_SVertex *self );
|
||||
static PyObject * SVertex_normalsSize( BPy_SVertex *self );
|
||||
static PyObject * SVertex_SetPoint3D( BPy_SVertex *self , PyObject *args);
|
||||
static PyObject * SVertex_SetPoint2D( BPy_SVertex *self , PyObject *args);
|
||||
static PyObject * SVertex_setPoint3D( BPy_SVertex *self , PyObject *args);
|
||||
static PyObject * SVertex_setPoint2D( BPy_SVertex *self , PyObject *args);
|
||||
static PyObject * SVertex_AddNormal( BPy_SVertex *self , PyObject *args);
|
||||
static PyObject * SVertex_SetId( BPy_SVertex *self , PyObject *args);
|
||||
static PyObject * SVertex_setId( BPy_SVertex *self , PyObject *args);
|
||||
static PyObject *SVertex_AddFEdge( BPy_SVertex *self , PyObject *args);
|
||||
|
||||
/*----------------------SVertex instance definitions ----------------------------*/
|
||||
@@ -25,10 +25,10 @@ static PyMethodDef BPy_SVertex_methods[] = {
|
||||
{"__copy__", ( PyCFunction ) SVertex___copy__, METH_NOARGS, "( )Cloning method."},
|
||||
{"normals", ( PyCFunction ) SVertex_normals, METH_NOARGS, "Returns the normals for this Vertex as a list. In a smooth surface, a vertex has exactly one normal. In a sharp surface, a vertex can have any number of normals."},
|
||||
{"normalsSize", ( PyCFunction ) SVertex_normalsSize, METH_NOARGS, "Returns the number of different normals for this vertex." },
|
||||
{"SetPoint3D", ( PyCFunction ) SVertex_SetPoint3D, METH_VARARGS, "Sets the 3D coordinates of the SVertex." },
|
||||
{"SetPoint2D", ( PyCFunction ) SVertex_SetPoint2D, METH_VARARGS, "Sets the 3D projected coordinates of the SVertex." },
|
||||
{"setPoint3D", ( PyCFunction ) SVertex_setPoint3D, METH_VARARGS, "Sets the 3D coordinates of the SVertex." },
|
||||
{"setPoint2D", ( PyCFunction ) SVertex_setPoint2D, METH_VARARGS, "Sets the 3D projected coordinates of the SVertex." },
|
||||
{"AddNormal", ( PyCFunction ) SVertex_AddNormal, METH_VARARGS, "Adds a normal to the Svertex's set of normals. If the same normal is already in the set, nothing changes." },
|
||||
{"SetId", ( PyCFunction ) SVertex_SetId, METH_VARARGS, "Sets the Id." },
|
||||
{"setId", ( PyCFunction ) SVertex_setId, METH_VARARGS, "Sets the Id." },
|
||||
{"AddFEdge", ( PyCFunction ) SVertex_AddFEdge, METH_VARARGS, "Add an FEdge to the list of edges emanating from this SVertex." },
|
||||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
@@ -177,36 +177,36 @@ PyObject * SVertex_normalsSize( BPy_SVertex *self ) {
|
||||
return PyInt_FromLong( self->sv->normalsSize() );
|
||||
}
|
||||
|
||||
PyObject *SVertex_SetPoint3D( BPy_SVertex *self , PyObject *args) {
|
||||
PyObject *SVertex_setPoint3D( BPy_SVertex *self , PyObject *args) {
|
||||
PyObject *py_point;
|
||||
|
||||
if(!( PyArg_ParseTuple(args, "O", &py_point)
|
||||
&& PyList_Check(py_point) && PyList_Size(py_point) == 3 )) {
|
||||
cout << "ERROR: SVertex_SetPoint3D" << endl;
|
||||
cout << "ERROR: SVertex_setPoint3D" << endl;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
Vec3r v( PyFloat_AsDouble( PyList_GetItem(py_point, 0) ),
|
||||
PyFloat_AsDouble( PyList_GetItem(py_point, 1) ),
|
||||
PyFloat_AsDouble( PyList_GetItem(py_point, 2) ) );
|
||||
self->sv->SetPoint3D( v );
|
||||
self->sv->setPoint3D( v );
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
PyObject *SVertex_SetPoint2D( BPy_SVertex *self , PyObject *args) {
|
||||
PyObject *SVertex_setPoint2D( BPy_SVertex *self , PyObject *args) {
|
||||
PyObject *py_point;
|
||||
|
||||
if(!( PyArg_ParseTuple(args, "O", &py_point)
|
||||
&& PyList_Check(py_point) && PyList_Size(py_point) == 3 )) {
|
||||
cout << "ERROR: SVertex_SetPoint2D" << endl;
|
||||
cout << "ERROR: SVertex_setPoint2D" << endl;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
Vec3r v( PyFloat_AsDouble( PyList_GetItem(py_point, 0) ),
|
||||
PyFloat_AsDouble( PyList_GetItem(py_point, 1) ),
|
||||
PyFloat_AsDouble( PyList_GetItem(py_point, 2) ) );
|
||||
self->sv->SetPoint2D( v );
|
||||
self->sv->setPoint2D( v );
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
@@ -228,15 +228,15 @@ PyObject *SVertex_AddNormal( BPy_SVertex *self , PyObject *args) {
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
PyObject *SVertex_SetId( BPy_SVertex *self , PyObject *args) {
|
||||
PyObject *SVertex_setId( BPy_SVertex *self , PyObject *args) {
|
||||
BPy_Id *py_id;
|
||||
|
||||
if( !PyArg_ParseTuple(args, "O", &py_id) ) {
|
||||
cout << "ERROR: SVertex_SetId" << endl;
|
||||
cout << "ERROR: SVertex_setId" << endl;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
self->sv->SetId( *(py_id->id) );
|
||||
self->sv->setId( *(py_id->id) );
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
@@ -15,8 +15,7 @@ extern "C" {
|
||||
|
||||
extern PyTypeObject SVertex_Type;
|
||||
|
||||
#define BPy_SVertex_Check(v) \
|
||||
((v)->ob_type == &SVertex_Type)
|
||||
#define BPy_SVertex_Check(v) (( (PyObject *) v)->ob_type == &SVertex_Type)
|
||||
|
||||
/*---------------------------Python BPy_SVertex structure definition----------*/
|
||||
typedef struct {
|
||||
|
||||
@@ -15,8 +15,7 @@ extern "C" {
|
||||
|
||||
extern PyTypeObject ViewVertex_Type;
|
||||
|
||||
#define BPy_ViewVertex_Check(v) \
|
||||
((v)->ob_type == &ViewVertex_Type)
|
||||
#define BPy_ViewVertex_Check(v) (( (PyObject *) v)->ob_type == &ViewVertex_Type)
|
||||
|
||||
/*---------------------------Python BPy_ViewVertex structure definition----------*/
|
||||
typedef struct {
|
||||
|
||||
@@ -13,8 +13,7 @@ extern "C" {
|
||||
|
||||
extern PyTypeObject Interface1D_Type;
|
||||
|
||||
#define BPy_Interface1D_Check(v) \
|
||||
((v)->ob_type == &Interface1D_Type)
|
||||
#define BPy_Interface1D_Check(v) (( (PyObject *) v)->ob_type == &Interface1D_Type)
|
||||
|
||||
/*---------------------------Python BPy_Interface1D structure definition----------*/
|
||||
typedef struct {
|
||||
|
||||
@@ -20,13 +20,13 @@ static PyObject * FEdge_previousEdge( BPy_FEdge *self );
|
||||
static PyObject * FEdge_getVertices( BPy_FEdge *self );
|
||||
static PyObject * FEdge_getPoints( BPy_FEdge *self );
|
||||
static PyObject * FEdge_isSmooth( BPy_FEdge *self );
|
||||
static PyObject * FEdge_SetVertexA( BPy_FEdge *self , PyObject *args);
|
||||
static PyObject * FEdge_SetVertexB( BPy_FEdge *self , PyObject *args);
|
||||
static PyObject * FEdge_SetId( BPy_FEdge *self , PyObject *args);
|
||||
static PyObject * FEdge_SetNextEdge( BPy_FEdge *self , PyObject *args);
|
||||
static PyObject * FEdge_SetPreviousEdge( BPy_FEdge *self , PyObject *args);
|
||||
static PyObject * FEdge_SetSmooth( BPy_FEdge *self , PyObject *args);
|
||||
static PyObject * FEdge_SetNature( BPy_FEdge *self, PyObject *args );
|
||||
static PyObject * FEdge_setVertexA( BPy_FEdge *self , PyObject *args);
|
||||
static PyObject * FEdge_setVertexB( BPy_FEdge *self , PyObject *args);
|
||||
static PyObject * FEdge_setId( BPy_FEdge *self , PyObject *args);
|
||||
static PyObject * FEdge_setNextEdge( BPy_FEdge *self , PyObject *args);
|
||||
static PyObject * FEdge_setPreviousEdge( BPy_FEdge *self , PyObject *args);
|
||||
static PyObject * FEdge_setSmooth( BPy_FEdge *self , PyObject *args);
|
||||
static PyObject * FEdge_setNature( BPy_FEdge *self, PyObject *args );
|
||||
|
||||
/*----------------------FEdge instance definitions ----------------------------*/
|
||||
static PyMethodDef BPy_FEdge_methods[] = {
|
||||
@@ -39,13 +39,13 @@ static PyMethodDef BPy_FEdge_methods[] = {
|
||||
{"getVertices", ( PyCFunction ) FEdge_getVertices, METH_NOARGS, "Returns the vertices"},
|
||||
{"getPoints", ( PyCFunction ) FEdge_getPoints, METH_NOARGS, "Returns the points. The difference with getVertices() is that here we can iterate over points of the 1D element at any given sampling. At each call, a virtual point is created."},
|
||||
{"isSmooth", ( PyCFunction ) FEdge_isSmooth, METH_NOARGS, "() Returns true if this FEdge is a smooth FEdge."},
|
||||
{"SetVertexA", ( PyCFunction ) FEdge_SetVertexA, METH_VARARGS, "(SVertex v) Sets the first SVertex. ."},
|
||||
{"SetVertexB", ( PyCFunction ) FEdge_SetVertexB, METH_VARARGS, "(SVertex v) Sets the second SVertex. "},
|
||||
{"SetId", ( PyCFunction ) FEdge_SetId, METH_VARARGS, "(Id id) Sets the FEdge Id ."},
|
||||
{"SetNextEdge", ( PyCFunction ) FEdge_SetNextEdge, METH_VARARGS, "(FEdge e) Sets the pointer to the next FEdge. "},
|
||||
{"SetPreviousEdge", ( PyCFunction ) FEdge_SetPreviousEdge, METH_VARARGS, "(FEdge e) Sets the pointer to the previous FEdge. "},
|
||||
{"SetSmooth", ( PyCFunction ) FEdge_SetSmooth, METH_VARARGS, "(bool b) Sets the flag telling whether this FEdge is smooth or sharp. true for Smooth, false for Sharp. "},
|
||||
{"SetNature", ( PyCFunction ) FEdge_SetNature, METH_VARARGS, "(Nature n) Sets the nature of this FEdge. "},
|
||||
{"setVertexA", ( PyCFunction ) FEdge_setVertexA, METH_VARARGS, "(SVertex v) Sets the first SVertex. ."},
|
||||
{"setVertexB", ( PyCFunction ) FEdge_setVertexB, METH_VARARGS, "(SVertex v) Sets the second SVertex. "},
|
||||
{"setId", ( PyCFunction ) FEdge_setId, METH_VARARGS, "(Id id) Sets the FEdge Id ."},
|
||||
{"setNextEdge", ( PyCFunction ) FEdge_setNextEdge, METH_VARARGS, "(FEdge e) Sets the pointer to the next FEdge. "},
|
||||
{"setPreviousEdge", ( PyCFunction ) FEdge_setPreviousEdge, METH_VARARGS, "(FEdge e) Sets the pointer to the previous FEdge. "},
|
||||
{"setSmooth", ( PyCFunction ) FEdge_setSmooth, METH_VARARGS, "(bool b) Sets the flag telling whether this FEdge is smooth or sharp. true for Smooth, false for Sharp. "},
|
||||
{"setNature", ( PyCFunction ) FEdge_setNature, METH_VARARGS, "(Nature n) Sets the nature of this FEdge. "},
|
||||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
@@ -221,86 +221,86 @@ PyObject * FEdge_isSmooth( BPy_FEdge *self ) {
|
||||
return PyBool_from_bool( self->fe->isSmooth() );
|
||||
}
|
||||
|
||||
PyObject *FEdge_SetVertexA( BPy_FEdge *self , PyObject *args) {
|
||||
PyObject *FEdge_setVertexA( BPy_FEdge *self , PyObject *args) {
|
||||
PyObject *py_sv;
|
||||
|
||||
if(!( PyArg_ParseTuple(args, "O", &py_sv) && BPy_SVertex_Check(py_sv) )) {
|
||||
cout << "ERROR: FEdge_SetVertexA" << endl;
|
||||
cout << "ERROR: FEdge_setVertexA" << endl;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
self->fe->SetVertexA( ((BPy_SVertex *) py_sv)->sv );
|
||||
self->fe->setVertexA( ((BPy_SVertex *) py_sv)->sv );
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
PyObject *FEdge_SetVertexB( BPy_FEdge *self , PyObject *args) {
|
||||
PyObject *FEdge_setVertexB( BPy_FEdge *self , PyObject *args) {
|
||||
PyObject *py_sv;
|
||||
|
||||
if(!( PyArg_ParseTuple(args, "O", &py_sv) && BPy_SVertex_Check(py_sv) )) {
|
||||
cout << "ERROR: FEdge_SetVertexB" << endl;
|
||||
cout << "ERROR: FEdge_setVertexB" << endl;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
self->fe->SetVertexB( ((BPy_SVertex *) py_sv)->sv );
|
||||
self->fe->setVertexB( ((BPy_SVertex *) py_sv)->sv );
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
PyObject *FEdge_SetId( BPy_FEdge *self , PyObject *args) {
|
||||
PyObject *FEdge_setId( BPy_FEdge *self , PyObject *args) {
|
||||
PyObject *py_id;
|
||||
|
||||
if(!( PyArg_ParseTuple(args, "O", &py_id) && BPy_Id_Check(py_id) )) {
|
||||
cout << "ERROR: FEdge_SetId" << endl;
|
||||
cout << "ERROR: FEdge_setId" << endl;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
self->fe->SetId(*( ((BPy_Id *) py_id)->id ));
|
||||
self->fe->setId(*( ((BPy_Id *) py_id)->id ));
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
|
||||
PyObject *FEdge_SetNextEdge( BPy_FEdge *self , PyObject *args) {
|
||||
PyObject *FEdge_setNextEdge( BPy_FEdge *self , PyObject *args) {
|
||||
PyObject *py_fe;
|
||||
|
||||
if(!( PyArg_ParseTuple(args, "O", &py_fe) && BPy_FEdge_Check(py_fe) )) {
|
||||
cout << "ERROR: FEdge_SetNextEdge" << endl;
|
||||
cout << "ERROR: FEdge_setNextEdge" << endl;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
self->fe->SetNextEdge( ((BPy_FEdge *) py_fe)->fe );
|
||||
self->fe->setNextEdge( ((BPy_FEdge *) py_fe)->fe );
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
PyObject *FEdge_SetPreviousEdge( BPy_FEdge *self , PyObject *args) {
|
||||
PyObject *FEdge_setPreviousEdge( BPy_FEdge *self , PyObject *args) {
|
||||
PyObject *py_fe;
|
||||
|
||||
if(!( PyArg_ParseTuple(args, "O", &py_fe) && BPy_FEdge_Check(py_fe) )) {
|
||||
cout << "ERROR: FEdge_SetPreviousEdge" << endl;
|
||||
cout << "ERROR: FEdge_setPreviousEdge" << endl;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
self->fe->SetPreviousEdge( ((BPy_FEdge *) py_fe)->fe );
|
||||
self->fe->setPreviousEdge( ((BPy_FEdge *) py_fe)->fe );
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
PyObject *FEdge_SetSmooth( BPy_FEdge *self , PyObject *args) {
|
||||
PyObject *FEdge_setSmooth( BPy_FEdge *self , PyObject *args) {
|
||||
int b;
|
||||
|
||||
if(!( PyArg_ParseTuple(args, "i", &b) )) {
|
||||
cout << "ERROR: FEdge_SetSmooth" << endl;
|
||||
cout << "ERROR: FEdge_setSmooth" << endl;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
self->fe->SetSmooth( (bool) b );
|
||||
self->fe->setSmooth( (bool) b );
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
PyObject * FEdge_SetNature( BPy_FEdge *self, PyObject *args ) {
|
||||
PyObject * FEdge_setNature( BPy_FEdge *self, PyObject *args ) {
|
||||
PyObject *py_n;
|
||||
|
||||
if(!( PyArg_ParseTuple(args, "O", &py_n) && BPy_Nature_Check(py_n) )) {
|
||||
@@ -309,7 +309,7 @@ PyObject * FEdge_SetNature( BPy_FEdge *self, PyObject *args ) {
|
||||
}
|
||||
|
||||
PyObject *i = (PyObject *) &( ((BPy_Nature *) py_n)->i );
|
||||
((FEdge *) self->py_if1D.if1D)->SetNature( PyInt_AsLong(i) );
|
||||
((FEdge *) self->py_if1D.if1D)->setNature( PyInt_AsLong(i) );
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
@@ -14,8 +14,7 @@ extern "C" {
|
||||
|
||||
extern PyTypeObject FEdge_Type;
|
||||
|
||||
#define BPy_FEdge_Check(v) \
|
||||
((v)->ob_type == &FEdge_Type)
|
||||
#define BPy_FEdge_Check(v) (( (PyObject *) v)->ob_type == &FEdge_Type)
|
||||
|
||||
/*---------------------------Python BPy_FEdge structure definition----------*/
|
||||
typedef struct {
|
||||
|
||||
@@ -13,8 +13,7 @@ extern "C" {
|
||||
|
||||
extern PyTypeObject Nature_Type;
|
||||
|
||||
#define BPy_Nature_Check(v) \
|
||||
((v)->ob_type == &Nature_Type)
|
||||
#define BPy_Nature_Check(v) (( (PyObject *) v)->ob_type == &Nature_Type)
|
||||
|
||||
/*---------------------------Python BPy_Nature structure definition----------*/
|
||||
typedef struct {
|
||||
|
||||
@@ -1,112 +1,484 @@
|
||||
PyObject *_wrap_StrokeAttribute_getColor(PyObject *self , PyObject *args) {
|
||||
#include "StrokeAttribute.h"
|
||||
|
||||
#include "Convert.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/*--------------- Python API function prototypes for StrokeAttribute instance -----------*/
|
||||
static int StrokeAttribute___init__(BPy_StrokeAttribute *self, PyObject *args, PyObject *kwds);
|
||||
static void StrokeAttribute___dealloc__(BPy_StrokeAttribute *self);
|
||||
static PyObject * StrokeAttribute___repr__(BPy_StrokeAttribute *self);
|
||||
|
||||
static PyObject * StrokeAttribute_getColorR( BPy_StrokeAttribute *self );
|
||||
static PyObject * StrokeAttribute_getColorG( BPy_StrokeAttribute *self );
|
||||
static PyObject * StrokeAttribute_getColorB( BPy_StrokeAttribute *self );
|
||||
static PyObject * StrokeAttribute_getColorRGB( BPy_StrokeAttribute *self );
|
||||
static PyObject * StrokeAttribute_getAlpha( BPy_StrokeAttribute *self );
|
||||
static PyObject * StrokeAttribute_getThicknessR( BPy_StrokeAttribute *self );
|
||||
static PyObject * StrokeAttribute_getThicknessL( BPy_StrokeAttribute *self );
|
||||
static PyObject * StrokeAttribute_getThicknessRL( BPy_StrokeAttribute *self );
|
||||
static PyObject * StrokeAttribute_isVisible( BPy_StrokeAttribute *self );
|
||||
static PyObject * StrokeAttribute_getAttributeReal( BPy_StrokeAttribute *self, PyObject *args );
|
||||
static PyObject * StrokeAttribute_getAttributeVec2f( BPy_StrokeAttribute *self, PyObject *args );
|
||||
static PyObject * StrokeAttribute_getAttributeVec3f( BPy_StrokeAttribute *self, PyObject *args );
|
||||
static PyObject * StrokeAttribute_isAttributeAvailableReal( BPy_StrokeAttribute *self, PyObject *args );
|
||||
static PyObject * StrokeAttribute_isAttributeAvailableVec2f( BPy_StrokeAttribute *self, PyObject *args );
|
||||
static PyObject * StrokeAttribute_isAttributeAvailableVec3f( BPy_StrokeAttribute *self, PyObject *args );
|
||||
static int StrokeAttribute_setColor( BPy_StrokeAttribute *self, PyObject *args );
|
||||
static int StrokeAttribute_setAlpha( BPy_StrokeAttribute *self, PyObject *args );
|
||||
static int StrokeAttribute_setThickness( BPy_StrokeAttribute *self, PyObject *args );
|
||||
static int StrokeAttribute_setVisible( BPy_StrokeAttribute *self, PyObject *args );
|
||||
static int StrokeAttribute_setAttributeReal( BPy_StrokeAttribute *self, PyObject *args );
|
||||
static int StrokeAttribute_setAttributeVec2f( BPy_StrokeAttribute *self, PyObject *args );
|
||||
static int StrokeAttribute_setAttributeVec3f( BPy_StrokeAttribute *self, PyObject *args );
|
||||
|
||||
|
||||
/*----------------------StrokeAttribute instance definitions ----------------------------*/
|
||||
static PyMethodDef BPy_StrokeAttribute_methods[] = {
|
||||
{"getColorR", ( PyCFunction ) StrokeAttribute_getColorR, METH_NOARGS, "Returns the R color component. "},
|
||||
{"getColorG", ( PyCFunction ) StrokeAttribute_getColorG, METH_NOARGS, "Returns the G color component. "},
|
||||
{"getColorB", ( PyCFunction ) StrokeAttribute_getColorB, METH_NOARGS, "Returns the B color component. "},
|
||||
{"getColorRGB", ( PyCFunction ) StrokeAttribute_getColorRGB, METH_NOARGS, "Returns the RGB color components."},
|
||||
{"getAlpha", ( PyCFunction ) StrokeAttribute_getAlpha, METH_NOARGS, "Returns the alpha color component."},
|
||||
{"getThicknessR", ( PyCFunction ) StrokeAttribute_getThicknessR, METH_NOARGS, "Returns the thickness on the right of the vertex when following the stroke. "},
|
||||
{"getThicknessL", ( PyCFunction ) StrokeAttribute_getThicknessL, METH_NOARGS, "Returns the thickness on the left of the vertex when following the stroke."},
|
||||
{"getThicknessRL", ( PyCFunction ) StrokeAttribute_getThicknessRL, METH_NOARGS, "Returns the thickness on the right and on the left of the vertex when following the stroke. "},
|
||||
{"isVisible", ( PyCFunction ) StrokeAttribute_isVisible, METH_NOARGS, "Returns true if the strokevertex is visible, false otherwise"},
|
||||
{"getAttributeReal", ( PyCFunction ) StrokeAttribute_getAttributeReal, METH_VARARGS, "(name) Returns an attribute of type real specified by name."},
|
||||
{"getAttributeVec2f", ( PyCFunction ) StrokeAttribute_getAttributeVec2f, METH_VARARGS, "(name) Returns an attribute of type Vec2f specified by name."},
|
||||
{"getAttributeVec3f", ( PyCFunction ) StrokeAttribute_getAttributeVec3f, METH_VARARGS, "(name) Returns an attribute of type Vec3f specified by name."},
|
||||
{"isAttributeAvailableReal", ( PyCFunction ) StrokeAttribute_isAttributeAvailableReal, METH_VARARGS, "(name) Checks whether the real attribute specified by name is available"},
|
||||
{"isAttributeAvailableVec2f", ( PyCFunction ) StrokeAttribute_isAttributeAvailableVec2f, METH_VARARGS, "(name) Checks whether the Vec2f attribute specified by name is available"},
|
||||
{"isAttributeAvailableVec3f", ( PyCFunction ) StrokeAttribute_isAttributeAvailableVec3f, METH_VARARGS, "(name) Checks whether the Vec3f attribute specified by name is available"},
|
||||
{"setColor", ( PyCFunction ) StrokeAttribute_setColor, METH_VARARGS, "(float a)Sets the attribute's alpha value. "},
|
||||
{"setAlpha", ( PyCFunction ) StrokeAttribute_setAlpha, METH_VARARGS, "(float a) Sets the attribute's alpha value."},
|
||||
{"setThickness", ( PyCFunction ) StrokeAttribute_setThickness, METH_VARARGS, ""},
|
||||
{"setVisible", ( PyCFunction ) StrokeAttribute_setVisible, METH_VARARGS, ""},
|
||||
{"setAttributeReal", ( PyCFunction ) StrokeAttribute_setAttributeReal, METH_VARARGS, "(name, float att) Adds a user defined attribute of type real. If there is no attribute of specified by name, it is added. Otherwise, the new value replaces the old one."},
|
||||
{"setAttributeVec2f", ( PyCFunction ) StrokeAttribute_setAttributeVec2f, METH_VARARGS, "(name, float att) Adds a user defined attribute of type Vec2f. If there is no attribute of specified by name, it is added. Otherwise, the new value replaces the old one."},
|
||||
{"setAttributeVec3f", ( PyCFunction ) StrokeAttribute_setAttributeVec3f, METH_VARARGS, "(name, float att) Adds a user defined attribute of type Vec4f. If there is no attribute of specified by name, it is added. Otherwise, the new value replaces the old one."},
|
||||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
/*-----------------------BPy_StrokeAttribute type definition ------------------------------*/
|
||||
|
||||
PyTypeObject StrokeAttribute_Type = {
|
||||
PyObject_HEAD_INIT( NULL )
|
||||
0, /* ob_size */
|
||||
"StrokeAttribute", /* tp_name */
|
||||
sizeof( BPy_StrokeAttribute ), /* tp_basicsize */
|
||||
0, /* tp_itemsize */
|
||||
|
||||
/* methods */
|
||||
(destructor)StrokeAttribute___dealloc__, /* tp_dealloc */
|
||||
NULL, /* printfunc tp_print; */
|
||||
NULL, /* getattrfunc tp_getattr; */
|
||||
NULL, /* setattrfunc tp_setattr; */
|
||||
NULL, /* tp_compare */
|
||||
(reprfunc)StrokeAttribute___repr__, /* tp_repr */
|
||||
|
||||
/* Method suites for standard classes */
|
||||
|
||||
NULL, /* PyNumberMethods *tp_as_number; */
|
||||
NULL, /* PySequenceMethods *tp_as_sequence; */
|
||||
NULL, /* PyMappingMethods *tp_as_mapping; */
|
||||
|
||||
/* More standard operations (here for binary compatibility) */
|
||||
|
||||
NULL, /* hashfunc tp_hash; */
|
||||
NULL, /* ternaryfunc tp_call; */
|
||||
NULL, /* reprfunc tp_str; */
|
||||
NULL, /* getattrofunc tp_getattro; */
|
||||
NULL, /* setattrofunc tp_setattro; */
|
||||
|
||||
/* Functions to access object as input/output buffer */
|
||||
NULL, /* PyBufferProcs *tp_as_buffer; */
|
||||
|
||||
/*** Flags to define presence of optional/expanded features ***/
|
||||
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* long tp_flags; */
|
||||
|
||||
NULL, /* char *tp_doc; Documentation string */
|
||||
/*** Assigned meaning in release 2.0 ***/
|
||||
/* call function for all accessible objects */
|
||||
NULL, /* traverseproc tp_traverse; */
|
||||
|
||||
/* delete references to contained objects */
|
||||
NULL, /* inquiry tp_clear; */
|
||||
|
||||
/*** Assigned meaning in release 2.1 ***/
|
||||
/*** rich comparisons ***/
|
||||
NULL, /* richcmpfunc tp_richcompare; */
|
||||
|
||||
/*** weak reference enabler ***/
|
||||
0, /* long tp_weaklistoffset; */
|
||||
|
||||
/*** Added in release 2.2 ***/
|
||||
/* Iterators */
|
||||
NULL, /* getiterfunc tp_iter; */
|
||||
NULL, /* iternextfunc tp_iternext; */
|
||||
|
||||
/*** Attribute descriptor and subclassing stuff ***/
|
||||
BPy_StrokeAttribute_methods, /* struct PyMethodDef *tp_methods; */
|
||||
NULL, /* struct PyMemberDef *tp_members; */
|
||||
NULL, /* struct PyGetSetDef *tp_getset; */
|
||||
NULL, /* struct _typeobject *tp_base; */
|
||||
NULL, /* PyObject *tp_dict; */
|
||||
NULL, /* descrgetfunc tp_descr_get; */
|
||||
NULL, /* descrsetfunc tp_descr_set; */
|
||||
0, /* long tp_dictoffset; */
|
||||
(initproc)StrokeAttribute___init__, /* initproc tp_init; */
|
||||
NULL, /* allocfunc tp_alloc; */
|
||||
PyType_GenericNew, /* newfunc tp_new; */
|
||||
|
||||
/* Low-level free-memory routine */
|
||||
NULL, /* freefunc tp_free; */
|
||||
|
||||
/* For PyObject_IS_GC */
|
||||
NULL, /* inquiry tp_is_gc; */
|
||||
NULL, /* PyObject *tp_bases; */
|
||||
|
||||
/* method resolution order */
|
||||
NULL, /* PyObject *tp_mro; */
|
||||
NULL, /* PyObject *tp_cache; */
|
||||
NULL, /* PyObject *tp_subclasses; */
|
||||
NULL, /* PyObject *tp_weaklist; */
|
||||
NULL
|
||||
};
|
||||
|
||||
//-------------------MODULE INITIALIZATION--------------------------------
|
||||
PyMODINIT_FUNC StrokeAttribute_Init( PyObject *module )
|
||||
{
|
||||
if( module == NULL )
|
||||
return;
|
||||
|
||||
if( PyType_Ready( &StrokeAttribute_Type ) < 0 )
|
||||
return;
|
||||
Py_INCREF( &StrokeAttribute_Type );
|
||||
PyModule_AddObject(module, "StrokeAttribute", (PyObject *)&StrokeAttribute_Type);
|
||||
|
||||
}
|
||||
|
||||
//------------------------INSTANCE METHODS ----------------------------------
|
||||
|
||||
int StrokeAttribute___init__(BPy_StrokeAttribute *self, PyObject *args, PyObject *kwds)
|
||||
{
|
||||
|
||||
PyObject *obj1 = 0, *obj2 = 0 , *obj3 = 0, *obj4 = 0, *obj5 = 0 , *obj6 = 0;
|
||||
|
||||
if (! PyArg_ParseTuple(args, "|OOOOOO", &obj1, &obj2, &obj3, &obj4, &obj5, &obj6) )
|
||||
return -1;
|
||||
|
||||
if( !obj1 || !obj2 || !obj3 ){
|
||||
|
||||
self->sa = new StrokeAttribute();
|
||||
|
||||
} else if( BPy_StrokeAttribute_Check(obj1) &&
|
||||
BPy_StrokeAttribute_Check(obj2) &&
|
||||
PyFloat_Check(obj3) ) {
|
||||
|
||||
self->sa = new StrokeAttribute( *( ((BPy_StrokeAttribute *) obj1)->sa ),
|
||||
*( ((BPy_StrokeAttribute *) obj2)->sa ),
|
||||
PyFloat_AsDouble( obj3 ) );
|
||||
|
||||
} else if( obj4 && obj5 && obj6 &&
|
||||
PyFloat_Check(obj1) && PyFloat_Check(obj2) && PyFloat_Check(obj2) &&
|
||||
PyFloat_Check(obj4) && PyFloat_Check(obj5) && PyFloat_Check(obj6) ) {
|
||||
|
||||
self->sa = new StrokeAttribute( PyFloat_AsDouble( obj1 ),
|
||||
PyFloat_AsDouble( obj2 ),
|
||||
PyFloat_AsDouble( obj3 ),
|
||||
PyFloat_AsDouble( obj4 ),
|
||||
PyFloat_AsDouble( obj5 ),
|
||||
PyFloat_AsDouble( obj6 ) );
|
||||
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
void StrokeAttribute___dealloc__(BPy_StrokeAttribute* self)
|
||||
{
|
||||
delete self->sa;
|
||||
self->ob_type->tp_free((PyObject*)self);
|
||||
}
|
||||
|
||||
PyObject * StrokeAttribute___repr__(BPy_StrokeAttribute* self)
|
||||
{
|
||||
return PyString_FromFormat("StrokeAttribute: r:%f g:%f b:%f a:%f - R:%f L:%f",
|
||||
self->sa->getColorR(), self->sa->getColorG(), self->sa->getColorB(), self->sa->getAlpha(),
|
||||
self->sa->getThicknessR(), self->sa->getThicknessL() );
|
||||
}
|
||||
|
||||
|
||||
PyObject *_wrap_StrokeAttribute_getColorR(PyObject *self , PyObject *args) {
|
||||
// PyObject *StrokeAttribute_getColor( BPy_StrokeAttribute *self ) {
|
||||
// float *c = self->sa->getColor();
|
||||
// Vec3f v( c[0], c[1], c[2]);
|
||||
// return Vector_from_Vec3f( v );
|
||||
// }
|
||||
|
||||
PyObject *StrokeAttribute_getColorR( BPy_StrokeAttribute *self ) {
|
||||
return PyFloat_FromDouble( self->sa->getColorR() );
|
||||
}
|
||||
|
||||
PyObject *StrokeAttribute_getColorG( BPy_StrokeAttribute *self ) {
|
||||
return PyFloat_FromDouble( self->sa->getColorG() );
|
||||
}
|
||||
|
||||
PyObject *StrokeAttribute_getColorB( BPy_StrokeAttribute *self ) {
|
||||
return PyFloat_FromDouble( self->sa->getColorB() );
|
||||
}
|
||||
|
||||
PyObject *StrokeAttribute_getColorRGB( BPy_StrokeAttribute *self ) {
|
||||
Vec3f v( self->sa->getColorRGB() );
|
||||
return Vector_from_Vec3f( v );
|
||||
}
|
||||
|
||||
PyObject *StrokeAttribute_getAlpha( BPy_StrokeAttribute *self ) {
|
||||
return PyFloat_FromDouble( self->sa->getAlpha() );
|
||||
}
|
||||
|
||||
// PyObject *StrokeAttribute_getThickness( BPy_StrokeAttribute *self ) {
|
||||
// // vector
|
||||
// return PyString_FromString( self->sa->getExactTypeName() );
|
||||
// }
|
||||
|
||||
PyObject *StrokeAttribute_getThicknessR( BPy_StrokeAttribute *self ) {
|
||||
return PyFloat_FromDouble( self->sa->getThicknessR() );
|
||||
}
|
||||
PyObject *StrokeAttribute_getThicknessL( BPy_StrokeAttribute *self ) {
|
||||
return PyFloat_FromDouble( self->sa->getThicknessL() );
|
||||
}
|
||||
PyObject *StrokeAttribute_getThicknessRL( BPy_StrokeAttribute *self ) {
|
||||
Vec2f v( self->sa->getThicknessRL() );
|
||||
return Vector_from_Vec2f( v );
|
||||
}
|
||||
|
||||
PyObject *StrokeAttribute_isVisible( BPy_StrokeAttribute *self ) {
|
||||
return PyBool_from_bool( self->sa->isVisible() );
|
||||
}
|
||||
|
||||
|
||||
PyObject *_wrap_StrokeAttribute_getColorG(PyObject *self , PyObject *args) {
|
||||
PyObject *StrokeAttribute_getAttributeReal( BPy_StrokeAttribute *self, PyObject *args ) {
|
||||
char *attr;
|
||||
|
||||
if(!( PyArg_ParseTuple(args, "s", &attr) )) {
|
||||
cout << "ERROR: StrokeAttribute_getAttributeReal" << endl;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
double a = self->sa->getAttributeReal( attr );
|
||||
return PyFloat_FromDouble( a );
|
||||
}
|
||||
|
||||
PyObject *StrokeAttribute_getAttributeVec2f( BPy_StrokeAttribute *self, PyObject *args ) {
|
||||
char *attr;
|
||||
|
||||
if(!( PyArg_ParseTuple(args, "s", &attr) )) {
|
||||
cout << "ERROR: StrokeAttribute_getAttributeVec2f" << endl;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
Vec2f a = self->sa->getAttributeVec2f( attr );
|
||||
return Vector_from_Vec2f( a );
|
||||
}
|
||||
|
||||
|
||||
PyObject *_wrap_StrokeAttribute_getColorB(PyObject *self , PyObject *args) {
|
||||
PyObject *StrokeAttribute_getAttributeVec3f( BPy_StrokeAttribute *self, PyObject *args ) {
|
||||
char *attr;
|
||||
|
||||
if(!( PyArg_ParseTuple(args, "s", &attr) )) {
|
||||
cout << "ERROR: StrokeAttribute_getAttributeVec3f" << endl;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
Vec3f a = self->sa->getAttributeVec3f( attr );
|
||||
return Vector_from_Vec3f( a );
|
||||
}
|
||||
|
||||
PyObject *StrokeAttribute_isAttributeAvailableReal( BPy_StrokeAttribute *self, PyObject *args ) {
|
||||
char *attr;
|
||||
|
||||
if(!( PyArg_ParseTuple(args, "s", &attr) )) {
|
||||
cout << "ERROR: StrokeAttribute_isAttributeAvailableReal" << endl;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
return PyBool_from_bool( self->sa->isAttributeAvailableReal( attr ) );
|
||||
}
|
||||
|
||||
PyObject *StrokeAttribute_isAttributeAvailableVec2f( BPy_StrokeAttribute *self, PyObject *args ) {
|
||||
char *attr;
|
||||
|
||||
if(!( PyArg_ParseTuple(args, "s", &attr) )) {
|
||||
cout << "ERROR: StrokeAttribute_isAttributeAvailableVec2f" << endl;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
return PyBool_from_bool( self->sa->isAttributeAvailableVec2f( attr ) );
|
||||
}
|
||||
|
||||
PyObject *StrokeAttribute_isAttributeAvailableVec3f( BPy_StrokeAttribute *self, PyObject *args ) {
|
||||
char *attr;
|
||||
|
||||
if(!( PyArg_ParseTuple(args, "s", &attr) )) {
|
||||
cout << "ERROR: StrokeAttribute_isAttributeAvailableVec3f" << endl;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
return PyBool_from_bool( self->sa->isAttributeAvailableVec3f( attr ) );
|
||||
}
|
||||
|
||||
|
||||
PyObject *_wrap_StrokeAttribute_getColorRGB(PyObject *self , PyObject *args) {
|
||||
int StrokeAttribute_setColor( BPy_StrokeAttribute *self, PyObject *args ) {
|
||||
PyObject *obj1 = 0, *obj2 = 0, *obj3 = 0 ;
|
||||
|
||||
if(!( PyArg_ParseTuple(args, "O|OO", &obj1, &obj2, &obj3) )) {
|
||||
cout << "ERROR: StrokeAttribute_setColor" << endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if( PyList_Check(obj1) && !obj2 && !obj3 ){
|
||||
|
||||
Vec3f v( PyFloat_AsDouble( PyList_GetItem(obj1, 0) ),
|
||||
PyFloat_AsDouble( PyList_GetItem(obj1, 1) ),
|
||||
PyFloat_AsDouble( PyList_GetItem(obj1, 2) ) );
|
||||
|
||||
self->sa->setColor( v );
|
||||
return 0;
|
||||
|
||||
} else if( obj1 && PyFloat_Check(obj1) &&
|
||||
obj2 && PyFloat_Check(obj2) &&
|
||||
obj3 && PyFloat_Check(obj3) ){
|
||||
|
||||
self->sa->setColor( PyFloat_AsDouble(obj1),
|
||||
PyFloat_AsDouble(obj2),
|
||||
PyFloat_AsDouble(obj3) );
|
||||
return 0;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
int StrokeAttribute_setAlpha( BPy_StrokeAttribute *self, PyObject *args ){
|
||||
float f = 0;
|
||||
|
||||
PyObject *_wrap_StrokeAttribute_getAlpha(PyObject *self , PyObject *args) {
|
||||
if(!( PyArg_ParseTuple(args, "f", &f) )) {
|
||||
cout << "ERROR: StrokeAttribute_setAlpha" << endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
self->sa->setAlpha( f );
|
||||
return 0;
|
||||
}
|
||||
|
||||
int StrokeAttribute_setThickness( BPy_StrokeAttribute *self, PyObject *args ) {
|
||||
PyObject *obj1 = 0, *obj2 = 0;
|
||||
|
||||
PyObject *_wrap_StrokeAttribute_getThickness(PyObject *self , PyObject *args) {
|
||||
if(!( PyArg_ParseTuple(args, "O|O", &obj1, &obj2) )) {
|
||||
cout << "ERROR: StrokeAttribute_setThickness" << endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if( PyList_Check(obj1) && !obj2 ){
|
||||
|
||||
Vec2f v( PyFloat_AsDouble( PyList_GetItem(obj1, 0) ),
|
||||
PyFloat_AsDouble( PyList_GetItem(obj1, 1) ) );
|
||||
|
||||
self->sa->setThickness( v );
|
||||
return 0;
|
||||
|
||||
} else if( obj1 && PyFloat_Check(obj1) &&
|
||||
obj2 && PyFloat_Check(obj2) ){
|
||||
|
||||
self->sa->setThickness( PyFloat_AsDouble(obj1),
|
||||
PyFloat_AsDouble(obj2) );
|
||||
return 0;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
int StrokeAttribute_setVisible( BPy_StrokeAttribute *self, PyObject *args ) {
|
||||
int i = 0;
|
||||
|
||||
PyObject *_wrap_StrokeAttribute_getThicknessR(PyObject *self , PyObject *args) {
|
||||
if(!( PyArg_ParseTuple(args, "i", &i) )) {
|
||||
cout << "ERROR: StrokeAttribute_setVisible" << endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
self->sa->setVisible( i );
|
||||
return 0;
|
||||
}
|
||||
|
||||
int StrokeAttribute_setAttributeReal( BPy_StrokeAttribute *self, PyObject *args ) {
|
||||
char *s = 0;
|
||||
double d = 0;
|
||||
|
||||
PyObject *_wrap_StrokeAttribute_getThicknessL(PyObject *self , PyObject *args) {
|
||||
if(!( PyArg_ParseTuple(args, "sd", &s, &d) )) {
|
||||
cout << "ERROR: StrokeAttribute_setAttributeReal" << endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
self->sa->setAttributeReal( s, d );
|
||||
return 0;
|
||||
}
|
||||
|
||||
int StrokeAttribute_setAttributeVec2f( BPy_StrokeAttribute *self, PyObject *args ) {
|
||||
char *s;
|
||||
PyObject *obj = 0;
|
||||
|
||||
PyObject *_wrap_StrokeAttribute_getThicknessRL(PyObject *self , PyObject *args) {
|
||||
if(!( PyArg_ParseTuple(args, "sO", &s, &obj) )) {
|
||||
cout << "ERROR: StrokeAttribute_setAttributeVec2f" << endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if( PyList_Check(obj) && PyList_Size(obj) > 1) {
|
||||
|
||||
Vec2f v( PyFloat_AsDouble( PyList_GetItem(obj, 0) ),
|
||||
PyFloat_AsDouble( PyList_GetItem(obj, 1) ) );
|
||||
|
||||
self->sa->setAttributeVec2f( s, v );
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
int StrokeAttribute_setAttributeVec3f( BPy_StrokeAttribute *self, PyObject *args ) {
|
||||
char *s;
|
||||
PyObject *obj = 0;
|
||||
|
||||
PyObject *_wrap_StrokeAttribute_isVisible(PyObject *self , PyObject *args) {
|
||||
if(!( PyArg_ParseTuple(args, "sO", &s, &obj) )) {
|
||||
cout << "ERROR: StrokeAttribute_setAttributeVec3f" << endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if( PyList_Check(obj) && PyList_Size(obj) > 2 ) {
|
||||
|
||||
Vec3f v( PyFloat_AsDouble( PyList_GetItem(obj, 0) ),
|
||||
PyFloat_AsDouble( PyList_GetItem(obj, 1) ),
|
||||
PyFloat_AsDouble( PyList_GetItem(obj, 2) ) );
|
||||
|
||||
self->sa->setAttributeVec3f( s, v );
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
PyObject *_wrap_StrokeAttribute_getAttributeReal(PyObject *self , PyObject *args) {
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
|
||||
PyObject *_wrap_StrokeAttribute_getAttributeVec2f(PyObject *self , PyObject *args) {
|
||||
}
|
||||
|
||||
|
||||
PyObject *_wrap_StrokeAttribute_getAttributeVec3f(PyObject *self , PyObject *args) {
|
||||
}
|
||||
|
||||
|
||||
PyObject *_wrap_StrokeAttribute_isAttributeAvailableReal(PyObject *self , PyObject *args) {
|
||||
}
|
||||
|
||||
|
||||
PyObject *_wrap_StrokeAttribute_isAttributeAvailableVec2f(PyObject *self , PyObject *args) {
|
||||
}
|
||||
|
||||
|
||||
PyObject *_wrap_StrokeAttribute_isAttributeAvailableVec3f(PyObject *self , PyObject *args) {
|
||||
}
|
||||
|
||||
|
||||
PyObject *_wrap_StrokeAttribute_setColor__SWIG_0(PyObject *self , PyObject *args) {
|
||||
}
|
||||
|
||||
|
||||
PyObject *_wrap_StrokeAttribute_setColor__SWIG_1(PyObject *self , PyObject *args) {
|
||||
}
|
||||
|
||||
|
||||
PyObject *_wrap_StrokeAttribute_setColor(PyObject *self, PyObject *args) {
|
||||
}
|
||||
|
||||
|
||||
PyObject *_wrap_StrokeAttribute_setAlpha(PyObject *self , PyObject *args) {
|
||||
}
|
||||
|
||||
|
||||
PyObject *_wrap_StrokeAttribute_setThickness__SWIG_0(PyObject *self , PyObject *args) {
|
||||
}
|
||||
|
||||
|
||||
PyObject *_wrap_StrokeAttribute_setThickness__SWIG_1(PyObject *self , PyObject *args) {
|
||||
}
|
||||
|
||||
|
||||
PyObject *_wrap_StrokeAttribute_setThickness(PyObject *self, PyObject *args) {
|
||||
}
|
||||
|
||||
|
||||
PyObject *_wrap_StrokeAttribute_SetVisible(PyObject *self , PyObject *args) {
|
||||
}
|
||||
|
||||
|
||||
PyObject *_wrap_StrokeAttribute_setAttributeReal(PyObject *self , PyObject *args) {
|
||||
}
|
||||
|
||||
|
||||
PyObject *_wrap_StrokeAttribute_setAttributeVec2f(PyObject *self , PyObject *args) {
|
||||
}
|
||||
|
||||
|
||||
PyObject *_wrap_StrokeAttribute_setAttributeVec3f(PyObject *self , PyObject *args) {
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
34
source/blender/freestyle/intern/python/StrokeAttribute.h
Normal file
34
source/blender/freestyle/intern/python/StrokeAttribute.h
Normal file
@@ -0,0 +1,34 @@
|
||||
#ifndef FREESTYLE_PYTHON_STROKEATTRIBUTE_H
|
||||
#define FREESTYLE_PYTHON_STROKEATTRIBUTE_H
|
||||
|
||||
#include "../stroke/Stroke.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <Python.h>
|
||||
|
||||
extern PyTypeObject StrokeAttribute_Type;
|
||||
|
||||
#define BPy_StrokeAttribute_Check(v) (( (PyObject *) v)->ob_type == &StrokeAttribute_Type)
|
||||
|
||||
/*---------------------------Python BPy_StrokeAttribute structure definition----------*/
|
||||
typedef struct {
|
||||
PyObject_HEAD
|
||||
StrokeAttribute *sa;
|
||||
} BPy_StrokeAttribute;
|
||||
|
||||
/*---------------------------Python BPy_StrokeAttribute visible prototypes-----------*/
|
||||
|
||||
PyMODINIT_FUNC StrokeAttribute_Init( PyObject *module );
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* FREESTYLE_PYTHON_STROKEATTRIBUTE_H */
|
||||
@@ -13,8 +13,7 @@ extern "C" {
|
||||
|
||||
extern PyTypeObject UnaryFunction0D_Type;
|
||||
|
||||
#define BPy_UnaryFunction0D_Check(v) \
|
||||
((v)->ob_type == &UnaryFunction0D_Type)
|
||||
#define BPy_UnaryFunction0D_Check(v) (( (PyObject *) v)->ob_type == &UnaryFunction0D_Type)
|
||||
|
||||
/*---------------------------Python BPy_UnaryFunction0D structure definition----------*/
|
||||
typedef struct {
|
||||
|
||||
@@ -13,8 +13,7 @@ extern "C" {
|
||||
|
||||
extern PyTypeObject UnaryFunction1D_Type;
|
||||
|
||||
#define BPy_UnaryFunction1D_Check(v) \
|
||||
((v)->ob_type == &UnaryFunction1D_Type)
|
||||
#define BPy_UnaryFunction1D_Check(v) (( (PyObject *) v)->ob_type == &UnaryFunction1D_Type)
|
||||
|
||||
/*---------------------------Python BPy_UnaryFunction1D structure definition----------*/
|
||||
typedef struct {
|
||||
|
||||
@@ -13,8 +13,7 @@ extern "C" {
|
||||
|
||||
extern PyTypeObject UnaryPredicate0D_Type;
|
||||
|
||||
#define BPy_UnaryPredicate0D_Check(v) \
|
||||
((v)->ob_type == &UnaryPredicate0D_Type)
|
||||
#define BPy_UnaryPredicate0D_Check(v) (( (PyObject *) v)->ob_type == &UnaryPredicate0D_Type)
|
||||
|
||||
/*---------------------------Python BPy_UnaryPredicate0D structure definition----------*/
|
||||
typedef struct {
|
||||
|
||||
@@ -13,8 +13,7 @@ extern "C" {
|
||||
|
||||
extern PyTypeObject UnaryPredicate1D_Type;
|
||||
|
||||
#define BPy_UnaryPredicate1D_Check(v) \
|
||||
((v)->ob_type == &UnaryPredicate1D_Type)
|
||||
#define BPy_UnaryPredicate1D_Check(v) (( (PyObject *) v)->ob_type == &UnaryPredicate1D_Type)
|
||||
|
||||
/*---------------------------Python BPy_UnaryPredicate1D structure definition----------*/
|
||||
typedef struct {
|
||||
|
||||
@@ -46,7 +46,7 @@ public:
|
||||
|
||||
inline GLDebugRenderer() : GLRenderer() {
|
||||
_bboxSize = 2.0;
|
||||
SetMaxValue(&_minEdgeSize);
|
||||
setMaxValue(&_minEdgeSize);
|
||||
_SelectedFEdge = 0;
|
||||
}
|
||||
|
||||
@@ -84,9 +84,9 @@ public:
|
||||
* iBBoxSize
|
||||
* The size of the scene bounding box.
|
||||
*/
|
||||
inline void ReInit(real iBBoxSize) {_bboxSize = iBBoxSize; SetMaxValue(&_minEdgeSize);}
|
||||
inline void ReInit(real iBBoxSize) {_bboxSize = iBBoxSize; setMaxValue(&_minEdgeSize);}
|
||||
|
||||
inline void SetSelectedFEdge(FEdge *iFEdge) {_SelectedFEdge = iFEdge;}
|
||||
inline void setSelectedFEdge(FEdge *iFEdge) {_SelectedFEdge = iFEdge;}
|
||||
inline FEdge * selectedFEdge() {return _SelectedFEdge;}
|
||||
|
||||
protected:
|
||||
@@ -170,8 +170,8 @@ protected:
|
||||
|
||||
private:
|
||||
|
||||
inline void SetMaxValue(float *oValue) {*oValue = FLT_MAX;}
|
||||
inline void SetMaxValue(real *oValue) {*oValue = DBL_MAX;}
|
||||
inline void setMaxValue(float *oValue) {*oValue = FLT_MAX;}
|
||||
inline void setMaxValue(real *oValue) {*oValue = DBL_MAX;}
|
||||
|
||||
mutable real _bboxSize;
|
||||
mutable real _minEdgeSize;
|
||||
|
||||
@@ -93,7 +93,7 @@ void GLRenderer::visitIndexedFaceSet(IndexedFaceSet& ifs)
|
||||
pti += numVertexPerFace[fIndex];
|
||||
}
|
||||
//glEndList();
|
||||
//ifs.SetDisplayList(dl);
|
||||
//ifs.setDisplayList(dl);
|
||||
}
|
||||
|
||||
void GLRenderer::visitNodeTransform(NodeTransform& tn) {
|
||||
|
||||
@@ -44,10 +44,10 @@ public:
|
||||
/*! operators */
|
||||
inline DrawingStyle& operator=(const DrawingStyle& ds);
|
||||
|
||||
inline void SetStyle(const STYLE iStyle) {Style = iStyle;}
|
||||
inline void SetLineWidth(const float iLineWidth) {LineWidth = iLineWidth;}
|
||||
inline void SetPointSize(const float iPointSize) {PointSize = iPointSize;}
|
||||
inline void SetLightingEnabled(const bool on) {LightingEnabled = on;}
|
||||
inline void setStyle(const STYLE iStyle) {Style = iStyle;}
|
||||
inline void setLineWidth(const float iLineWidth) {LineWidth = iLineWidth;}
|
||||
inline void setPointSize(const float iPointSize) {PointSize = iPointSize;}
|
||||
inline void setLightingEnabled(const bool on) {LightingEnabled = on;}
|
||||
|
||||
inline STYLE style() const {return Style;}
|
||||
inline float lineWidth() const {return LineWidth;}
|
||||
|
||||
@@ -317,5 +317,5 @@ void IndexedFaceSet::ComputeBBox()
|
||||
v++;
|
||||
}
|
||||
|
||||
SetBBox(BBox<Vec3r>(Vec3r(XMin, YMin, ZMin), Vec3r(XMax, YMax, ZMax)));
|
||||
setBBox(BBox<Vec3r>(Vec3r(XMin, YMin, ZMin), Vec3r(XMax, YMax, ZMax)));
|
||||
}
|
||||
|
||||
@@ -166,7 +166,7 @@ public:
|
||||
virtual void ComputeBBox();
|
||||
|
||||
/*! modifiers */
|
||||
inline void SetDisplayList(unsigned int index) {_displayList = index;}
|
||||
inline void setDisplayList(unsigned int index) {_displayList = index;}
|
||||
|
||||
/*! Accessors */
|
||||
virtual const real * vertices() const {return _Vertices;}
|
||||
|
||||
@@ -54,5 +54,5 @@ void LineRep::ComputeBBox()
|
||||
ZMin = (*v)[2];
|
||||
}
|
||||
|
||||
SetBBox(BBox<Vec3r>(Vec3r(XMin, YMin, ZMin), Vec3r(XMax, YMax, ZMax)));
|
||||
setBBox(BBox<Vec3r>(Vec3r(XMin, YMin, ZMin), Vec3r(XMax, YMax, ZMax)));
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ public:
|
||||
inline LineRep(const Vec3r& v1, const Vec3r& v2)
|
||||
: Rep()
|
||||
{
|
||||
SetStyle(LINES);
|
||||
setStyle(LINES);
|
||||
AddVertex(v1);
|
||||
AddVertex(v2);
|
||||
_width = 0.f;
|
||||
@@ -66,7 +66,7 @@ public:
|
||||
: Rep()
|
||||
{
|
||||
_vertices = vertices;
|
||||
SetStyle(LINE_STRIP);
|
||||
setStyle(LINE_STRIP);
|
||||
_width = 0.f;
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ public:
|
||||
{
|
||||
_vertices.push_back(*v);
|
||||
}
|
||||
SetStyle(LINE_STRIP);
|
||||
setStyle(LINE_STRIP);
|
||||
_width = 0.f;
|
||||
}
|
||||
|
||||
@@ -95,9 +95,9 @@ public:
|
||||
inline float width() const {return _width;}
|
||||
|
||||
/*! modifiers */
|
||||
inline void SetStyle(const LINES_STYLE iStyle) {_Style = iStyle;}
|
||||
inline void setStyle(const LINES_STYLE iStyle) {_Style = iStyle;}
|
||||
inline void AddVertex(const Vec3r& iVertex) {_vertices.push_back(iVertex);}
|
||||
inline void SetVertices(const vector<Vec3r>& iVertices)
|
||||
inline void setVertices(const vector<Vec3r>& iVertices)
|
||||
{
|
||||
if(0 != _vertices.size())
|
||||
{
|
||||
@@ -110,7 +110,7 @@ public:
|
||||
_vertices.push_back(*v);
|
||||
}
|
||||
}
|
||||
inline void SetWidth(float iWidth) {_width=iWidth;}
|
||||
inline void setWidth(float iWidth) {_width=iWidth;}
|
||||
|
||||
/*! Accept the corresponding visitor */
|
||||
virtual void accept(SceneVisitor& v) {
|
||||
|
||||
@@ -120,7 +120,7 @@ public:
|
||||
* \param a
|
||||
* Alpha component
|
||||
*/
|
||||
inline void SetDiffuse(const float r, const float g, const float b, const float a);
|
||||
inline void setDiffuse(const float r, const float g, const float b, const float a);
|
||||
/*! Sets the specular color.
|
||||
* \param r
|
||||
* Red component
|
||||
@@ -131,7 +131,7 @@ public:
|
||||
* \param a
|
||||
* Alpha component
|
||||
*/
|
||||
inline void SetSpecular(const float r, const float g, const float b, const float a);
|
||||
inline void setSpecular(const float r, const float g, const float b, const float a);
|
||||
/*! Sets the ambiant color.
|
||||
* \param r
|
||||
* Red component
|
||||
@@ -142,7 +142,7 @@ public:
|
||||
* \param a
|
||||
* Alpha component
|
||||
*/
|
||||
inline void SetAmbient(const float r, const float g, const float b, const float a);
|
||||
inline void setAmbient(const float r, const float g, const float b, const float a);
|
||||
|
||||
/*! Sets the emissive color.
|
||||
* \param r
|
||||
@@ -154,13 +154,13 @@ public:
|
||||
* \param a
|
||||
* Alpha component
|
||||
*/
|
||||
inline void SetEmission(const float r, const float g, const float b, const float a);
|
||||
inline void setEmission(const float r, const float g, const float b, const float a);
|
||||
|
||||
/*! Sets the shininess.
|
||||
* \param s
|
||||
* Shininess
|
||||
*/
|
||||
inline void SetShininess(const float s);
|
||||
inline void setShininess(const float s);
|
||||
|
||||
/* operators */
|
||||
inline Material& operator=(const Material& m);
|
||||
@@ -225,7 +225,7 @@ Material::Material(const Material& m)
|
||||
Shininess = m.shininess();
|
||||
}
|
||||
|
||||
void Material::SetDiffuse(const float r, const float g, const float b, const float a)
|
||||
void Material::setDiffuse(const float r, const float g, const float b, const float a)
|
||||
{
|
||||
Diffuse[0] = r;
|
||||
Diffuse[1] = g;
|
||||
@@ -233,7 +233,7 @@ void Material::SetDiffuse(const float r, const float g, const float b, const flo
|
||||
Diffuse[3] = a;
|
||||
}
|
||||
|
||||
void Material::SetSpecular(const float r, const float g, const float b, const float a)
|
||||
void Material::setSpecular(const float r, const float g, const float b, const float a)
|
||||
{
|
||||
Specular[0] = r;
|
||||
Specular[1] = g;
|
||||
@@ -241,7 +241,7 @@ void Material::SetSpecular(const float r, const float g, const float b, const fl
|
||||
Specular[3] = a;
|
||||
}
|
||||
|
||||
void Material::SetAmbient(const float r, const float g, const float b, const float a)
|
||||
void Material::setAmbient(const float r, const float g, const float b, const float a)
|
||||
{
|
||||
Ambient[0] = r;
|
||||
Ambient[1] = g;
|
||||
@@ -249,7 +249,7 @@ void Material::SetAmbient(const float r, const float g, const float b, const flo
|
||||
Ambient[3] = a;
|
||||
}
|
||||
|
||||
void Material::SetEmission(const float r, const float g, const float b, const float a)
|
||||
void Material::setEmission(const float r, const float g, const float b, const float a)
|
||||
{
|
||||
Emission[0] = r;
|
||||
Emission[1] = g;
|
||||
@@ -257,7 +257,7 @@ void Material::SetEmission(const float r, const float g, const float b, const fl
|
||||
Emission[3] = a;
|
||||
}
|
||||
|
||||
void Material::SetShininess(const float s)
|
||||
void Material::setShininess(const float s)
|
||||
{
|
||||
Shininess = s;
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ MaxFileLoader::~MaxFileLoader()
|
||||
_Scene = NULL;
|
||||
}
|
||||
|
||||
void MaxFileLoader::SetFileName(const char *iFileName)
|
||||
void MaxFileLoader::setFileName(const char *iFileName)
|
||||
{
|
||||
if(NULL != _FileName)
|
||||
delete [] _FileName;
|
||||
@@ -224,17 +224,17 @@ void MaxFileLoader::RenderNode(Lib3dsNode *iNode)
|
||||
|
||||
if (mat)
|
||||
{
|
||||
tmpMat.SetDiffuse(mat->diffuse[0], mat->diffuse[1], mat->diffuse[2], mat->diffuse[3]);
|
||||
tmpMat.SetSpecular(mat->specular[0], mat->specular[1], mat->specular[2], mat->specular[3]);
|
||||
tmpMat.setDiffuse(mat->diffuse[0], mat->diffuse[1], mat->diffuse[2], mat->diffuse[3]);
|
||||
tmpMat.setSpecular(mat->specular[0], mat->specular[1], mat->specular[2], mat->specular[3]);
|
||||
float s = (float)pow(2.0, 10.0*mat->shininess);
|
||||
if(s > 128.f)
|
||||
s = 128.f;
|
||||
tmpMat.SetShininess(s);
|
||||
tmpMat.setShininess(s);
|
||||
}
|
||||
|
||||
if(meshMaterials.empty()){
|
||||
meshMaterials.push_back(tmpMat);
|
||||
shape->SetMaterial(tmpMat);
|
||||
shape->setMaterial(tmpMat);
|
||||
}else{
|
||||
// find if the material is aleady in the list
|
||||
unsigned i=0;
|
||||
@@ -357,12 +357,12 @@ void MaxFileLoader::RenderNode(Lib3dsNode *iNode)
|
||||
0,0,
|
||||
0);
|
||||
// sets the id of the rep
|
||||
rep->SetId(Id(iNode->node_id, 0));
|
||||
rep->setId(Id(iNode->node_id, 0));
|
||||
|
||||
|
||||
const BBox<Vec3r> bbox = BBox<Vec3r>(Vec3r(minBBox[0], minBBox[1], minBBox[2]),
|
||||
Vec3r(maxBBox[0], maxBBox[1], maxBBox[2]));
|
||||
rep->SetBBox(bbox);
|
||||
rep->setBBox(bbox);
|
||||
shape->AddRep(rep);
|
||||
}
|
||||
|
||||
@@ -376,7 +376,7 @@ void MaxFileLoader::RenderNode(Lib3dsNode *iNode)
|
||||
for(unsigned j=0; j<4; j++)
|
||||
M44f(i,j) = iNode->matrix[j][i];
|
||||
|
||||
currentMesh->SetMatrix(Matrix44r(M44f));
|
||||
currentMesh->setMatrix(Matrix44r(M44f));
|
||||
currentMesh->Translate(-d->pivot[0], -d->pivot[1], -d->pivot[2]);
|
||||
}
|
||||
shape = (NodeShape*)iNode->user.d;
|
||||
|
||||
@@ -70,7 +70,7 @@ public:
|
||||
virtual ~MaxFileLoader();
|
||||
|
||||
/*! Sets the name of the 3dsMax file to load */
|
||||
void SetFileName(const char *iFileName);
|
||||
void setFileName(const char *iFileName);
|
||||
|
||||
/*! Loads the 3D scene and returns
|
||||
* a pointer to the scene root node
|
||||
|
||||
@@ -68,7 +68,7 @@ public:
|
||||
virtual const BBox<Vec3r>& bbox() const {return _BBox;}
|
||||
|
||||
/*! Sets the Node bounding box */
|
||||
virtual void SetBBox(const BBox<Vec3r>& iBox) {_BBox = iBox;}
|
||||
virtual void setBBox(const BBox<Vec3r>& iBox) {_BBox = iBox;}
|
||||
|
||||
/*! Makes the union of _BBox and iBox */
|
||||
virtual void AddBBox(const BBox<Vec3r>& iBox)
|
||||
|
||||
@@ -43,16 +43,16 @@ public:
|
||||
virtual ~NodeDrawingStyle() {}
|
||||
|
||||
inline const DrawingStyle& drawingStyle() const { return _DrawingStyle; }
|
||||
inline void SetDrawingStyle(const DrawingStyle& iDrawingStyle) { _DrawingStyle = iDrawingStyle; }
|
||||
inline void setDrawingStyle(const DrawingStyle& iDrawingStyle) { _DrawingStyle = iDrawingStyle; }
|
||||
|
||||
/*! Sets the style. Must be one of FILLED, LINES, POINTS, INVISIBLE. */
|
||||
inline void SetStyle(const DrawingStyle::STYLE iStyle) { _DrawingStyle.SetStyle(iStyle); }
|
||||
inline void setStyle(const DrawingStyle::STYLE iStyle) { _DrawingStyle.setStyle(iStyle); }
|
||||
/*! Sets the line width in the LINES style case */
|
||||
inline void SetLineWidth(const float iLineWidth) { _DrawingStyle.SetLineWidth(iLineWidth); }
|
||||
inline void setLineWidth(const float iLineWidth) { _DrawingStyle.setLineWidth(iLineWidth); }
|
||||
/*! Sets the Point size in the POINTS style case */
|
||||
inline void SetPointSize(const float iPointSize) { _DrawingStyle.SetPointSize(iPointSize); }
|
||||
inline void setPointSize(const float iPointSize) { _DrawingStyle.setPointSize(iPointSize); }
|
||||
/*! Enables or disables the lighting. TRUE = enable */
|
||||
inline void SetLightingEnabled(const bool iEnableLighting) { _DrawingStyle.SetLightingEnabled(iEnableLighting); }
|
||||
inline void setLightingEnabled(const bool iEnableLighting) { _DrawingStyle.setLightingEnabled(iEnableLighting); }
|
||||
|
||||
/*! Accept the corresponding visitor */
|
||||
virtual void accept(SceneVisitor& v);
|
||||
|
||||
@@ -71,7 +71,7 @@ public:
|
||||
virtual void accept(SceneVisitor& v);
|
||||
|
||||
/*! Sets the shape material */
|
||||
inline void SetMaterial(const Material& iMaterial) { _Material = iMaterial; }
|
||||
inline void setMaterial(const Material& iMaterial) { _Material = iMaterial; }
|
||||
|
||||
/*! accessors */
|
||||
/*! returns the shape's material */
|
||||
|
||||
@@ -91,7 +91,7 @@ void NodeTransform::MultiplyMatrix(const Matrix44r &iMatrix)
|
||||
_Matrix = mat_tmp * iMatrix;
|
||||
}
|
||||
|
||||
void NodeTransform::SetMatrix(const Matrix44r &iMatrix)
|
||||
void NodeTransform::setMatrix(const Matrix44r &iMatrix)
|
||||
{
|
||||
_Matrix = iMatrix;
|
||||
if(isScaled(iMatrix))
|
||||
|
||||
@@ -77,7 +77,7 @@ public:
|
||||
void MultiplyMatrix(const Matrix44r &iMatrix);
|
||||
|
||||
/*! Sets the current matrix to iMatrix */
|
||||
void SetMatrix(const Matrix44r &iMatrix);
|
||||
void setMatrix(const Matrix44r &iMatrix);
|
||||
|
||||
/*! Accept the corresponding visitor */
|
||||
virtual void accept(SceneVisitor& v);
|
||||
|
||||
@@ -111,9 +111,9 @@ public:
|
||||
inline const Material * material() const {return _Material;}
|
||||
|
||||
/*! Sets the Rep bounding box */
|
||||
virtual void SetBBox(const BBox<Vec3r>& iBox) {_BBox = iBox;}
|
||||
inline void SetId(const Id& id) {_Id = id;}
|
||||
inline void SetMaterial(const Material& iMaterial)
|
||||
virtual void setBBox(const BBox<Vec3r>& iBox) {_BBox = iBox;}
|
||||
inline void setId(const Id& id) {_Id = id;}
|
||||
inline void setMaterial(const Material& iMaterial)
|
||||
{
|
||||
_Material = new Material(iMaterial);
|
||||
}
|
||||
|
||||
@@ -55,5 +55,5 @@ void TriangleRep::ComputeBBox()
|
||||
|
||||
}
|
||||
|
||||
SetBBox(BBox<Vec3r>(Vec3r(XMin, YMin, ZMin), Vec3r(XMax, YMax, ZMax)));
|
||||
setBBox(BBox<Vec3r>(Vec3r(XMin, YMin, ZMin), Vec3r(XMax, YMax, ZMax)));
|
||||
}
|
||||
|
||||
@@ -85,11 +85,11 @@ public:
|
||||
inline const Vec3r& vertex(int index) const {return _vertices[index];}
|
||||
inline const Vec3r& color(int index) const {return _colors[index];}
|
||||
/*! modifiers */
|
||||
inline void SetStyle(const TRIANGLE_STYLE iStyle) {_Style = iStyle;}
|
||||
inline void SetVertex(int index, const Vec3r& iVertex) {_vertices[index] = iVertex;}
|
||||
inline void SetColor(int index, const Vec3r& iColor) {_colors[index] = iColor;}
|
||||
inline void SetVertices(const Vec3r& v0, const Vec3r& v1, const Vec3r& v2) {_vertices[0] = v0; _vertices[1] = v1; _vertices[2] = v2;}
|
||||
inline void SetColors(const Vec3r& c0, const Vec3r& c1, const Vec3r& c2) {_colors[0] = c0; _colors[1] = c1; _colors[2] = c2;}
|
||||
inline void setStyle(const TRIANGLE_STYLE iStyle) {_Style = iStyle;}
|
||||
inline void setVertex(int index, const Vec3r& iVertex) {_vertices[index] = iVertex;}
|
||||
inline void setColor(int index, const Vec3r& iColor) {_colors[index] = iColor;}
|
||||
inline void setVertices(const Vec3r& v0, const Vec3r& v1, const Vec3r& v2) {_vertices[0] = v0; _vertices[1] = v1; _vertices[2] = v2;}
|
||||
inline void setColors(const Vec3r& c0, const Vec3r& c1, const Vec3r& c2) {_colors[0] = c0; _colors[1] = c1; _colors[2] = c2;}
|
||||
|
||||
/*! Accept the corresponding visitor */
|
||||
virtual void accept(SceneVisitor& v) {
|
||||
|
||||
@@ -24,6 +24,6 @@
|
||||
void VertexRep::ComputeBBox()
|
||||
{
|
||||
|
||||
SetBBox(BBox<Vec3r>(Vec3r(_coordinates[0], _coordinates[1], _coordinates[2]),
|
||||
setBBox(BBox<Vec3r>(Vec3r(_coordinates[0], _coordinates[1], _coordinates[2]),
|
||||
Vec3r(_coordinates[0], _coordinates[1], _coordinates[2])));
|
||||
}
|
||||
|
||||
@@ -71,12 +71,12 @@ public:
|
||||
inline float pointSize() const {return _PointSize;}
|
||||
|
||||
/*! modifiers */
|
||||
inline void SetVid(int id) {_vid = id;}
|
||||
inline void setVid(int id) {_vid = id;}
|
||||
inline void setX(real x) {_coordinates[0] = x;}
|
||||
inline void setY(real y) {_coordinates[1] = y;}
|
||||
inline void setZ(real z) {_coordinates[2] = z;}
|
||||
inline void SetCoordinates(real x, real y, real z) {_coordinates[0] = x;_coordinates[1] = y; _coordinates[2] = z;}
|
||||
inline void SetPointSize(float iPointSize) {_PointSize = iPointSize;}
|
||||
inline void setCoordinates(real x, real y, real z) {_coordinates[0] = x;_coordinates[1] = y; _coordinates[2] = z;}
|
||||
inline void setPointSize(float iPointSize) {_PointSize = iPointSize;}
|
||||
|
||||
private:
|
||||
int _vid; // vertex id
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace Functions0D {
|
||||
* value. (the larger, the smoother)
|
||||
*/
|
||||
DensityF0D(double sigma = 2) : UnaryFunction0D<double>() {
|
||||
_filter.SetSigma((float)sigma);
|
||||
_filter.setSigma((float)sigma);
|
||||
}
|
||||
/*! Returns the string "DensityF0D"*/
|
||||
string getName() const {
|
||||
@@ -87,7 +87,7 @@ namespace Functions0D {
|
||||
* will be used.
|
||||
*/
|
||||
LocalAverageDepthF0D(real maskSize=5.f) : UnaryFunction0D<double>() {
|
||||
_filter.SetSigma((float)maskSize/2.f);
|
||||
_filter.setSigma((float)maskSize/2.f);
|
||||
}
|
||||
/*! Returns the string "LocalAverageDepthF0D"*/
|
||||
string getName() const {
|
||||
|
||||
@@ -153,7 +153,7 @@ SpatialNoiseShader::shade(Stroke &ioStroke) const
|
||||
Vec2r noise(-ori2d[1]*_amount*bruit,
|
||||
ori2d[0]*_amount*bruit);
|
||||
|
||||
sv->SetPoint(p[0]+noise[0], p[1]+noise[1]);
|
||||
sv->setPoint(p[0]+noise[0], p[1]+noise[1]);
|
||||
p0=p;
|
||||
|
||||
++v;
|
||||
@@ -351,7 +351,7 @@ Smoother::copyVertices ()
|
||||
const Vec2r p1(_vertex[i]);
|
||||
Vec2r p(p0 + _carricatureFactor * (p1 - p0));
|
||||
|
||||
(v)->SetPoint(p[0], p[1]);
|
||||
(v)->setPoint(p[0], p[1]);
|
||||
i++;
|
||||
}
|
||||
|
||||
|
||||
@@ -520,9 +520,9 @@ namespace StrokeShaders {
|
||||
break;
|
||||
}
|
||||
unsigned int texId = instance->getBrushTextureIndex(pathname, mediumType);
|
||||
stroke.SetMediumType(mediumType);
|
||||
stroke.SetTips(hasTips);
|
||||
stroke.SetTextureId(texId);
|
||||
stroke.setMediumType(mediumType);
|
||||
stroke.setTips(hasTips);
|
||||
stroke.setTextureId(texId);
|
||||
}
|
||||
|
||||
// FIXME
|
||||
@@ -533,9 +533,9 @@ namespace StrokeShaders {
|
||||
return;
|
||||
string pathname = TextureManager::Options::getBrushesPath() + "/" + _texturePath;
|
||||
unsigned int texId = instance->getBrushTextureIndex(pathname, _mediumType);
|
||||
stroke.SetMediumType(_mediumType);
|
||||
stroke.SetTips(_tips);
|
||||
stroke.SetTextureId(texId);
|
||||
stroke.setMediumType(_mediumType);
|
||||
stroke.setTips(_tips);
|
||||
stroke.setTextureId(texId);
|
||||
}
|
||||
|
||||
//
|
||||
@@ -564,9 +564,9 @@ namespace StrokeShaders {
|
||||
dn.normalize();
|
||||
|
||||
Vec2d newFirst(first+_amount*d1);
|
||||
(v0)->SetPoint(newFirst[0], newFirst[1]);
|
||||
(v0)->setPoint(newFirst[0], newFirst[1]);
|
||||
Vec2d newLast(last+_amount*dn);
|
||||
(vn)->SetPoint(newLast[0], newLast[1]);
|
||||
(vn)->setPoint(newLast[0], newLast[1]);
|
||||
}
|
||||
|
||||
void SamplingShader::shade(Stroke& stroke) const
|
||||
@@ -585,7 +585,7 @@ namespace StrokeShaders {
|
||||
Vec2f n(fun(it));
|
||||
sv = dynamic_cast<StrokeVertex*>(&(*it));
|
||||
Vec2d newPoint(sv->x()+_amount*n.x(), sv->y()+_amount*n.y());
|
||||
sv->SetPoint(newPoint[0], newPoint[1]);
|
||||
sv->setPoint(newPoint[0], newPoint[1]);
|
||||
++it;
|
||||
}
|
||||
}
|
||||
@@ -686,8 +686,8 @@ namespace StrokeShaders {
|
||||
((it!=itend) && (p!=pend));
|
||||
++it)
|
||||
{
|
||||
it->SetX(p->x());
|
||||
it->SetY(p->y());
|
||||
it->setX(p->x());
|
||||
it->setY(p->y());
|
||||
last = p;
|
||||
++p;
|
||||
++n;
|
||||
@@ -695,8 +695,8 @@ namespace StrokeShaders {
|
||||
// nExtraVertex should stay unassigned
|
||||
for(int i=0; i< nExtraVertex; ++i)
|
||||
{
|
||||
it->SetX(last->x());
|
||||
it->SetY(last->y());
|
||||
it->setX(last->x());
|
||||
it->setY(last->y());
|
||||
if(it.isEnd())
|
||||
cerr << "Warning: Problem encountered while creating B-spline" << endl;
|
||||
++it;
|
||||
@@ -810,8 +810,8 @@ namespace StrokeShaders {
|
||||
((it!=itend) && (p!=pend));
|
||||
++it)
|
||||
{
|
||||
it->SetX(p->x());
|
||||
it->SetY(p->y());
|
||||
it->setX(p->x());
|
||||
it->setY(p->y());
|
||||
// double x = p->x();
|
||||
// double y = p->y();
|
||||
// cout << "x = " << x << "-" << "y = " << y << endl;
|
||||
@@ -859,7 +859,7 @@ namespace StrokeShaders {
|
||||
(it!=itend) && (a!=aend);
|
||||
++it)
|
||||
{
|
||||
(it)->SetAttribute(*a);
|
||||
(it)->setAttribute(*a);
|
||||
if((index <= index1)||(index>index2))
|
||||
++a;
|
||||
++index;
|
||||
@@ -894,7 +894,7 @@ namespace StrokeShaders {
|
||||
float t = 4.f*(0.25f - (u-0.5)*(u-0.5));
|
||||
float curvature_coeff = (M_PI-curv_fun(it))/M_PI;
|
||||
Vec2d newPoint(sv->x()+curvature_coeff*t*_amount*n.x(), sv->y()+curvature_coeff*t*_amount*n.y());
|
||||
sv->SetPoint(newPoint[0], newPoint[1]);
|
||||
sv->setPoint(newPoint[0], newPoint[1]);
|
||||
++it;
|
||||
}
|
||||
}
|
||||
@@ -998,10 +998,10 @@ namespace StrokeShaders {
|
||||
v!=b;
|
||||
++v)
|
||||
{
|
||||
v->SetPoint((*cp)->A.x()+v->u()*u.x()+n.x()*offset, (*cp)->A.y()+v->u()*u.y()+n.y()*offset);
|
||||
v->setPoint((*cp)->A.x()+v->u()*u.x()+n.x()*offset, (*cp)->A.y()+v->u()*u.y()+n.y()*offset);
|
||||
}
|
||||
// u.normalize();
|
||||
// (*a)->SetPoint((*a)->x()-u.x()*10, (*a)->y()-u.y()*10);
|
||||
// (*a)->setPoint((*a)->x()-u.x()*10, (*a)->y()-u.y()*10);
|
||||
}
|
||||
|
||||
// delete stuff
|
||||
@@ -1036,7 +1036,7 @@ namespace StrokeShaders {
|
||||
v!=vend;
|
||||
++v)
|
||||
{
|
||||
v->SetPoint(piece.A.x()+v->u()*u.x()+n.x()*offset, piece.A.y()+v->u()*u.y()+n.y()*offset);
|
||||
v->setPoint(piece.A.x()+v->u()*u.x()+n.x()*offset, piece.A.y()+v->u()*u.y()+n.y()*offset);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1101,7 +1101,7 @@ namespace StrokeShaders {
|
||||
//cout << "-----------------------------------------------" << endl;
|
||||
for(;(v!=vend)&&(a!=aend);++v,++a)
|
||||
{
|
||||
v->SetAttribute(*a);
|
||||
v->setAttribute(*a);
|
||||
//cout << "thickness = " << (*a).getThickness()[0] << "-" << (*a).getThickness()[1] << endl;
|
||||
}
|
||||
// we're done!
|
||||
|
||||
@@ -258,7 +258,7 @@ void Canvas::ReplaceStyleModule(unsigned index, StyleModule *iStyleModule)
|
||||
}
|
||||
}
|
||||
|
||||
void Canvas::SetVisible(unsigned index, bool iVisible) {
|
||||
void Canvas::setVisible(unsigned index, bool iVisible) {
|
||||
_StyleModules[index]->setDisplayed(iVisible);
|
||||
}
|
||||
|
||||
|
||||
@@ -177,16 +177,16 @@ public:
|
||||
virtual bool getRecordFlag() const {return false;}
|
||||
|
||||
/*! modifiers */
|
||||
inline void SetSelectedFEdge(FEdge *iFEdge) {_SelectedFEdge = iFEdge;}
|
||||
inline void setSelectedFEdge(FEdge *iFEdge) {_SelectedFEdge = iFEdge;}
|
||||
/*! inserts a shader at pos index+1 */
|
||||
void InsertStyleModule(unsigned index, StyleModule *iStyleModule);
|
||||
void RemoveStyleModule(unsigned index);
|
||||
void SwapStyleModules(unsigned i1, unsigned i2);
|
||||
void ReplaceStyleModule(unsigned index, StyleModule *iStyleModule);
|
||||
void SetVisible(unsigned index, bool iVisible) ;
|
||||
//inline void SetDensityMap(InformationMap<RGBImage>* iMap) {_DensityMap = iMap;}
|
||||
void setVisible(unsigned index, bool iVisible) ;
|
||||
//inline void setDensityMap(InformationMap<RGBImage>* iMap) {_DensityMap = iMap;}
|
||||
inline void AddLayer(StrokeLayer *iLayer) {_Layers.push_back(iLayer);}
|
||||
inline void SetCurrentPaperTextureIndex(int i) {_paperTextureIndex = i;}
|
||||
inline void setCurrentPaperTextureIndex(int i) {_paperTextureIndex = i;}
|
||||
void changePaperTexture(bool increment=true) ;
|
||||
/*! enables/disables paper texture */
|
||||
inline void togglePaperTexture() {_drawPaper = !_drawPaper;}
|
||||
|
||||
@@ -218,14 +218,14 @@ public:
|
||||
/*! Sets the first SVertex upon which to build
|
||||
* the CurvePoint.
|
||||
*/
|
||||
inline void SetA(SVertex *iA) {__A = iA;}
|
||||
inline void setA(SVertex *iA) {__A = iA;}
|
||||
/*! Sets the second SVertex upon which to build
|
||||
* the CurvePoint.
|
||||
*/
|
||||
inline void SetB(SVertex *iB) {__B = iB;}
|
||||
inline void setB(SVertex *iB) {__B = iB;}
|
||||
/*! Sets the 2D interpolation parameter to use.
|
||||
*/
|
||||
inline void SetT2d(float t) {_t2d = t;}
|
||||
inline void setT2d(float t) {_t2d = t;}
|
||||
//inline void SetT3d(float t) {_t3d = t;}
|
||||
|
||||
/* Information access interface */
|
||||
|
||||
@@ -64,7 +64,7 @@ struct TimestampModifier : public EdgeModifier<Edge>
|
||||
virtual void operator()(Edge& iEdge)
|
||||
{
|
||||
TimeStamp *timestamp = TimeStamp::instance();
|
||||
iEdge.SetTimeStamp(timestamp->getTimeStamp());
|
||||
iEdge.setTimeStamp(timestamp->getTimeStamp());
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -756,7 +756,7 @@ void Operators::sort(BinaryPredicate1D& pred) {
|
||||
|
||||
Stroke* createStroke(Interface1D& inter) {
|
||||
Stroke* stroke = new Stroke;
|
||||
stroke->SetId(inter.getId());
|
||||
stroke->setId(inter.getId());
|
||||
|
||||
float currentCurvilignAbscissa = 0.f;
|
||||
|
||||
@@ -784,7 +784,7 @@ Stroke* createStroke(Interface1D& inter) {
|
||||
current = stroke_vertex->point2d();
|
||||
Vec3r vec_tmp(current - previous);
|
||||
currentCurvilignAbscissa += vec_tmp.norm();
|
||||
stroke_vertex->SetCurvilinearAbscissa(currentCurvilignAbscissa);
|
||||
stroke_vertex->setCurvilinearAbscissa(currentCurvilignAbscissa);
|
||||
stroke->push_back(stroke_vertex);
|
||||
previous = current;
|
||||
++it;
|
||||
@@ -805,10 +805,10 @@ Stroke* createStroke(Interface1D& inter) {
|
||||
current = stroke_vertex->point2d();
|
||||
Vec3r vec_tmp(current - previous);
|
||||
currentCurvilignAbscissa += vec_tmp.norm();
|
||||
stroke_vertex->SetCurvilinearAbscissa(currentCurvilignAbscissa);
|
||||
stroke_vertex->setCurvilinearAbscissa(currentCurvilignAbscissa);
|
||||
stroke->push_back(stroke_vertex);
|
||||
}
|
||||
stroke->SetLength(currentCurvilignAbscissa);
|
||||
stroke->setLength(currentCurvilignAbscissa);
|
||||
return stroke;
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ public:
|
||||
virtual void retrieveMeanAndVariance(int x, int y, float &oMean, float &oVariance) ;
|
||||
|
||||
inline const QImage& map() const {return _map;}
|
||||
inline void SetMap(const QImage& iMap, float iw, float ih) {_map = iMap.copy();_w=iw;_h=ih;}
|
||||
inline void setMap(const QImage& iMap, float iw, float ih) {_map = iMap.copy();_w=iw;_h=ih;}
|
||||
|
||||
protected:
|
||||
virtual float computeGaussian(int x, int y);
|
||||
|
||||
@@ -450,14 +450,14 @@ Stroke& Stroke::operator=(const Stroke& iBrother)
|
||||
}
|
||||
|
||||
|
||||
void Stroke::SetLength(float iLength)
|
||||
void Stroke::setLength(float iLength)
|
||||
{
|
||||
_Length = iLength;
|
||||
for(vertex_container::iterator v=_Vertices.begin(), vend=_Vertices.end();
|
||||
v!=vend;
|
||||
++v)
|
||||
{
|
||||
(*v)->SetStrokeLength(iLength);
|
||||
(*v)->setStrokeLength(iLength);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -635,7 +635,7 @@ void Stroke::Resample(float iSampling)
|
||||
while(t<limit)
|
||||
{
|
||||
newVertex = new StrokeVertex(&(*it),&(*next),t);
|
||||
//newVertex->SetCurvilinearAbscissa(curvilinearLength);
|
||||
//newVertex->setCurvilinearAbscissa(curvilinearLength);
|
||||
newVertices.push_back(newVertex);
|
||||
t = t + _sampling/norm_var;
|
||||
}
|
||||
@@ -681,7 +681,7 @@ void Stroke::RemoveVertex(StrokeVertex *iVertex)
|
||||
{
|
||||
if(it != previous)
|
||||
curvabsc += ((*it)->point2d()-(*previous)->point2d()).norm();
|
||||
(*it)->SetCurvilinearAbscissa(curvabsc);
|
||||
(*it)->setCurvilinearAbscissa(curvabsc);
|
||||
previous = it;
|
||||
}
|
||||
_Length = curvabsc;
|
||||
@@ -690,7 +690,7 @@ void Stroke::RemoveVertex(StrokeVertex *iVertex)
|
||||
(it!=itend);
|
||||
++it)
|
||||
{
|
||||
(*it)->SetStrokeLength(_Length);
|
||||
(*it)->setStrokeLength(_Length);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -710,7 +710,7 @@ void Stroke::InsertVertex(StrokeVertex *iVertex, StrokeInternal::StrokeVertexIte
|
||||
++it)
|
||||
{
|
||||
curvabsc += ((*it)->point2d()-(*previous)->point2d()).norm();
|
||||
(*it)->SetCurvilinearAbscissa(curvabsc);
|
||||
(*it)->setCurvilinearAbscissa(curvabsc);
|
||||
previous = it;
|
||||
}
|
||||
_Length = curvabsc;
|
||||
@@ -718,7 +718,7 @@ void Stroke::InsertVertex(StrokeVertex *iVertex, StrokeInternal::StrokeVertexIte
|
||||
(it!=itend);
|
||||
++it)
|
||||
{
|
||||
(*it)->SetStrokeLength(_Length);
|
||||
(*it)->setStrokeLength(_Length);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -152,7 +152,7 @@ public:
|
||||
bool isAttributeAvailableVec3f(const char *iName) const ;
|
||||
|
||||
/* modifiers */
|
||||
/*! Sets the attribute's color.
|
||||
/*! sets the attribute's color.
|
||||
* \param r
|
||||
* The new R value.
|
||||
* \param g
|
||||
@@ -161,31 +161,31 @@ public:
|
||||
* The new B value.
|
||||
*/
|
||||
inline void setColor(float r, float g, float b) { _color[0]=r; _color[1]=g; _color[2]=b; }
|
||||
/*! Sets the attribute's color.
|
||||
/*! sets the attribute's color.
|
||||
* \param iRGB
|
||||
* The new RGB values.
|
||||
*/
|
||||
inline void setColor(const Vec3f& iRGB) { _color[0]=iRGB[0]; _color[1]=iRGB[1]; _color[2]=iRGB[2]; }
|
||||
/*! Sets the attribute's alpha value.
|
||||
/*! sets the attribute's alpha value.
|
||||
* \param alpha
|
||||
* The new alpha value.
|
||||
*/
|
||||
inline void setAlpha(float alpha) { _alpha = alpha; }
|
||||
/*! Sets the attribute's thickness.
|
||||
/*! sets the attribute's thickness.
|
||||
* \param tr
|
||||
* The thickness on the right of the vertex when following the stroke.
|
||||
* \param tl
|
||||
* The thickness on the left of the vertex when following the stroke.
|
||||
*/
|
||||
inline void setThickness(float tr, float tl) { _thickness[0]=tr; _thickness[1]=tl; }
|
||||
/*! Sets the attribute's thickness.
|
||||
/*! sets the attribute's thickness.
|
||||
* \param tRL
|
||||
* The thickness on the right and on the left of the vertex when following the stroke.
|
||||
*/
|
||||
inline void setThickness(const Vec2f& tRL) { _thickness[0]=tRL[0]; _thickness[1]=tRL[1]; }
|
||||
|
||||
/*! Sets the visible flag. True means visible. */
|
||||
inline void SetVisible(bool iVisible){ _visible = iVisible; }
|
||||
/*! sets the visible flag. True means visible. */
|
||||
inline void setVisible(bool iVisible){ _visible = iVisible; }
|
||||
|
||||
/*! Adds a user defined attribute of type real
|
||||
* If there is no attribute of name iName, it is added.
|
||||
@@ -295,24 +295,24 @@ public:
|
||||
inline float u() const {return _CurvilignAbscissa/_StrokeLength;}
|
||||
|
||||
/* modifiers */
|
||||
/*! Sets the 2D x value */
|
||||
inline void SetX(real x) { _Point2d[0]=x; }
|
||||
/*! Sets the 2D y value */
|
||||
inline void SetY(real y) { _Point2d[1]=y; }
|
||||
/*! Sets the 2D x and y values */
|
||||
inline void SetPoint(real x, real y) { _Point2d[0]=x; _Point2d[1]=y;}
|
||||
/*! Sets the 2D x and y values */
|
||||
inline void SetPoint(const Vec2f& p) { _Point2d[0] = p[0];_Point2d[1] = p[1];}
|
||||
/*! sets the 2D x value */
|
||||
inline void setX(real x) { _Point2d[0]=x; }
|
||||
/*! sets the 2D y value */
|
||||
inline void setY(real y) { _Point2d[1]=y; }
|
||||
/*! sets the 2D x and y values */
|
||||
inline void setPoint(real x, real y) { _Point2d[0]=x; _Point2d[1]=y;}
|
||||
/*! sets the 2D x and y values */
|
||||
inline void setPoint(const Vec2f& p) { _Point2d[0] = p[0];_Point2d[1] = p[1];}
|
||||
/*! Returns a reference to the ith 2D point coordinate (i=0 or 1) */
|
||||
inline real& operator[](const int i) { return _Point2d[i]; }
|
||||
/*! Sets the attribute. */
|
||||
inline void SetAttribute(const StrokeAttribute& iAttribute) { _Attribute = iAttribute; }
|
||||
/*! Sets the curvilinear abscissa of this StrokeVertex in the Stroke */
|
||||
inline void SetCurvilinearAbscissa(float iAbscissa) {_CurvilignAbscissa = iAbscissa;}
|
||||
/*! Sets the Stroke's length (it's only a value stored by the Stroke Vertex, it won't
|
||||
/*! sets the attribute. */
|
||||
inline void setAttribute(const StrokeAttribute& iAttribute) { _Attribute = iAttribute; }
|
||||
/*! sets the curvilinear abscissa of this StrokeVertex in the Stroke */
|
||||
inline void setCurvilinearAbscissa(float iAbscissa) {_CurvilignAbscissa = iAbscissa;}
|
||||
/*! sets the Stroke's length (it's only a value stored by the Stroke Vertex, it won't
|
||||
* change the real Stroke's length.)
|
||||
*/
|
||||
inline void SetStrokeLength(float iLength) {_StrokeLength = iLength;}
|
||||
inline void setStrokeLength(float iLength) {_StrokeLength = iLength;}
|
||||
|
||||
/* interface definition */
|
||||
/* inherited */
|
||||
@@ -502,26 +502,26 @@ public:
|
||||
|
||||
|
||||
/* modifiers */
|
||||
/*! Sets the Id of the Stroke. */
|
||||
inline void SetId(const Id& id) {_id = id;}
|
||||
/*! Sets the 2D length of the Stroke. */
|
||||
void SetLength(float iLength);
|
||||
/*! Sets the medium type that must be used for this Stroke. */
|
||||
inline void SetMediumType(MediumType iType) {_mediumType = iType;}
|
||||
/*! Sets the texture id to be used to simulate the marks system for this Stroke. */
|
||||
inline void SetTextureId(unsigned int id) {_textureId = id;}
|
||||
/*! Sets the flag telling whether this stroke is using a texture with
|
||||
/*! sets the Id of the Stroke. */
|
||||
inline void setId(const Id& id) {_id = id;}
|
||||
/*! sets the 2D length of the Stroke. */
|
||||
void setLength(float iLength);
|
||||
/*! sets the medium type that must be used for this Stroke. */
|
||||
inline void setMediumType(MediumType iType) {_mediumType = iType;}
|
||||
/*! sets the texture id to be used to simulate the marks system for this Stroke. */
|
||||
inline void setTextureId(unsigned int id) {_textureId = id;}
|
||||
/*! sets the flag telling whether this stroke is using a texture with
|
||||
* tips or not.
|
||||
*/
|
||||
inline void SetTips(bool iTips) {_tips = iTips;}
|
||||
inline void setTips(bool iTips) {_tips = iTips;}
|
||||
|
||||
inline void push_back(StrokeVertex* iVertex) { _Vertices.push_back(iVertex); }
|
||||
inline void push_front(StrokeVertex* iVertex) { _Vertices.push_front(iVertex); }
|
||||
inline void AddViewEdge(ViewEdge *iViewEdge) {_ViewEdges.push_back(iViewEdge);}
|
||||
inline void SetBeginningOrientation(const Vec2r& iOrientation) {_extremityOrientations[0] = iOrientation;}
|
||||
inline void SetBeginningOrientation(real x, real y) {_extremityOrientations[0] = Vec2r(x,y);}
|
||||
inline void SetEndingOrientation(const Vec2r& iOrientation) {_extremityOrientations[1] = iOrientation;}
|
||||
inline void SetEndingOrientation(real x, real y) {_extremityOrientations[1] = Vec2r(x,y);}
|
||||
inline void setBeginningOrientation(const Vec2r& iOrientation) {_extremityOrientations[0] = iOrientation;}
|
||||
inline void setBeginningOrientation(real x, real y) {_extremityOrientations[0] = Vec2r(x,y);}
|
||||
inline void setEndingOrientation(const Vec2r& iOrientation) {_extremityOrientations[1] = iOrientation;}
|
||||
inline void setEndingOrientation(real x, real y) {_extremityOrientations[1] = Vec2r(x,y);}
|
||||
|
||||
/* Information access interface */
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ public:
|
||||
inline bool empty() const {return _strokes.empty();}
|
||||
|
||||
/*! modifiers */
|
||||
inline void SetStrokes(stroke_container& iStrokes) {_strokes = iStrokes;}
|
||||
inline void setStrokes(stroke_container& iStrokes) {_strokes = iStrokes;}
|
||||
inline void AddStroke(Stroke *iStroke) {_strokes.push_back(iStroke);}
|
||||
|
||||
};
|
||||
|
||||
@@ -130,7 +130,7 @@ public:
|
||||
|
||||
/*! modifiers */
|
||||
inline void setMediumType(Stroke::MediumType itype) {_strokeType=itype;}
|
||||
inline void SetTextureId(unsigned textureId) {_textureId = textureId;}
|
||||
inline void setTextureId(unsigned textureId) {_textureId = textureId;}
|
||||
|
||||
|
||||
};
|
||||
|
||||
@@ -36,7 +36,7 @@ LineRep* StrokeTesselator::Tesselate(Stroke *iStroke)
|
||||
Stroke::vertex_iterator v,vend;
|
||||
if(2 == iStroke->vertices_size())
|
||||
{
|
||||
line->SetStyle(LineRep::LINES);
|
||||
line->setStyle(LineRep::LINES);
|
||||
v = iStroke->vertices_begin();
|
||||
StrokeVertex *svA= (*v);
|
||||
v++;
|
||||
@@ -49,9 +49,9 @@ LineRep* StrokeTesselator::Tesselate(Stroke *iStroke)
|
||||
else
|
||||
{
|
||||
if(_overloadMaterial)
|
||||
line->SetMaterial(_Material);
|
||||
line->setMaterial(_Material);
|
||||
|
||||
line->SetStyle(LineRep::LINE_STRIP);
|
||||
line->setStyle(LineRep::LINE_STRIP);
|
||||
|
||||
for(v=iStroke->vertices_begin(), vend=iStroke->vertices_end();
|
||||
v!=vend;
|
||||
@@ -62,7 +62,7 @@ LineRep* StrokeTesselator::Tesselate(Stroke *iStroke)
|
||||
line->AddVertex(V);
|
||||
}
|
||||
}
|
||||
line->SetId(iStroke->getId());
|
||||
line->setId(iStroke->getId());
|
||||
line->ComputeBBox();
|
||||
|
||||
return line;
|
||||
@@ -74,8 +74,8 @@ NodeGroup* StrokeTesselator::Tesselate(StrokeVertexIterator begin, StrokeVertexI
|
||||
NodeGroup *group = new NodeGroup;
|
||||
NodeShape *tshape = new NodeShape;
|
||||
group->AddChild(tshape);
|
||||
//tshape->material().SetDiffuse(0.f, 0.f, 0.f, 1.f);
|
||||
tshape->SetMaterial(_Material);
|
||||
//tshape->material().setDiffuse(0.f, 0.f, 0.f, 1.f);
|
||||
tshape->setMaterial(_Material);
|
||||
|
||||
for(StrokeVertexIterator c=begin, cend=end;
|
||||
c!=cend;
|
||||
|
||||
@@ -38,7 +38,7 @@ class StrokeTesselator
|
||||
{
|
||||
public:
|
||||
|
||||
inline StrokeTesselator() {_Material.SetDiffuse(0,0,0,1);_overloadMaterial=false;}
|
||||
inline StrokeTesselator() {_Material.setDiffuse(0,0,0,1);_overloadMaterial=false;}
|
||||
virtual ~StrokeTesselator() {}
|
||||
|
||||
/*! Builds a line rep contained from a Stroke
|
||||
@@ -54,7 +54,7 @@ public:
|
||||
|
||||
|
||||
|
||||
inline void SetMaterial(const Material& iMaterial) {_Material=iMaterial;_overloadMaterial=true;}
|
||||
inline void setMaterial(const Material& iMaterial) {_Material=iMaterial;_overloadMaterial=true;}
|
||||
inline const Material& material() const {return _Material;}
|
||||
|
||||
private:
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
/* ----------------------------------------------------------------------------
|
||||
* This file was automatically generated by SWIG (http://www.swig.org).
|
||||
* Version 1.3.35
|
||||
* Version 1.3.31
|
||||
*
|
||||
* This file is not intended to be easily readable and contains a number of
|
||||
* coding conventions designed to improve portability and efficiency. Do not make
|
||||
@@ -73,7 +73,7 @@ private:
|
||||
};
|
||||
|
||||
|
||||
class SwigDirector_UnaryFunction0DVoid : public UnaryFunction0D< void >, public Swig::Director {
|
||||
class SwigDirector_UnaryFunction0DVoid : public UnaryFunction0D<void >, public Swig::Director {
|
||||
|
||||
public:
|
||||
SwigDirector_UnaryFunction0DVoid(PyObject *self);
|
||||
@@ -119,7 +119,7 @@ private:
|
||||
};
|
||||
|
||||
|
||||
class SwigDirector_UnaryFunction0DUnsigned : public UnaryFunction0D< unsigned int >, public Swig::Director {
|
||||
class SwigDirector_UnaryFunction0DUnsigned : public UnaryFunction0D<unsigned int >, public Swig::Director {
|
||||
|
||||
public:
|
||||
SwigDirector_UnaryFunction0DUnsigned(PyObject *self);
|
||||
@@ -165,7 +165,7 @@ private:
|
||||
};
|
||||
|
||||
|
||||
class SwigDirector_UnaryFunction0DFloat : public UnaryFunction0D< float >, public Swig::Director {
|
||||
class SwigDirector_UnaryFunction0DFloat : public UnaryFunction0D<float >, public Swig::Director {
|
||||
|
||||
public:
|
||||
SwigDirector_UnaryFunction0DFloat(PyObject *self);
|
||||
@@ -211,7 +211,7 @@ private:
|
||||
};
|
||||
|
||||
|
||||
class SwigDirector_UnaryFunction0DDouble : public UnaryFunction0D< double >, public Swig::Director {
|
||||
class SwigDirector_UnaryFunction0DDouble : public UnaryFunction0D<double >, public Swig::Director {
|
||||
|
||||
public:
|
||||
SwigDirector_UnaryFunction0DDouble(PyObject *self);
|
||||
@@ -257,13 +257,13 @@ private:
|
||||
};
|
||||
|
||||
|
||||
class SwigDirector_UnaryFunction0DVec2f : public UnaryFunction0D< Geometry::Vec2f >, public Swig::Director {
|
||||
class SwigDirector_UnaryFunction0DVec2f : public UnaryFunction0D<Geometry::Vec2f >, public Swig::Director {
|
||||
|
||||
public:
|
||||
SwigDirector_UnaryFunction0DVec2f(PyObject *self);
|
||||
virtual ~SwigDirector_UnaryFunction0DVec2f();
|
||||
virtual std::string getName() const;
|
||||
virtual VecMat::Vec2< float > operator ()(Interface0DIterator &iter);
|
||||
virtual VecMat::Vec2<float > operator ()(Interface0DIterator &iter);
|
||||
|
||||
|
||||
/* Internal Director utilities */
|
||||
@@ -303,13 +303,13 @@ private:
|
||||
};
|
||||
|
||||
|
||||
class SwigDirector_UnaryFunction0DVec3f : public UnaryFunction0D< Geometry::Vec3f >, public Swig::Director {
|
||||
class SwigDirector_UnaryFunction0DVec3f : public UnaryFunction0D<Geometry::Vec3f >, public Swig::Director {
|
||||
|
||||
public:
|
||||
SwigDirector_UnaryFunction0DVec3f(PyObject *self);
|
||||
virtual ~SwigDirector_UnaryFunction0DVec3f();
|
||||
virtual std::string getName() const;
|
||||
virtual VecMat::Vec3< float > operator ()(Interface0DIterator &iter);
|
||||
virtual VecMat::Vec3<float > operator ()(Interface0DIterator &iter);
|
||||
|
||||
|
||||
/* Internal Director utilities */
|
||||
@@ -349,7 +349,7 @@ private:
|
||||
};
|
||||
|
||||
|
||||
class SwigDirector_UnaryFunction0DId : public UnaryFunction0D< Id >, public Swig::Director {
|
||||
class SwigDirector_UnaryFunction0DId : public UnaryFunction0D<Id >, public Swig::Director {
|
||||
|
||||
public:
|
||||
SwigDirector_UnaryFunction0DId(PyObject *self);
|
||||
@@ -395,7 +395,7 @@ private:
|
||||
};
|
||||
|
||||
|
||||
class SwigDirector_UnaryFunction1DVoid : public UnaryFunction1D< void >, public Swig::Director {
|
||||
class SwigDirector_UnaryFunction1DVoid : public UnaryFunction1D<void >, public Swig::Director {
|
||||
|
||||
public:
|
||||
SwigDirector_UnaryFunction1DVoid(PyObject *self);
|
||||
@@ -442,7 +442,7 @@ private:
|
||||
};
|
||||
|
||||
|
||||
class SwigDirector_UnaryFunction1DUnsigned : public UnaryFunction1D< unsigned int >, public Swig::Director {
|
||||
class SwigDirector_UnaryFunction1DUnsigned : public UnaryFunction1D<unsigned int >, public Swig::Director {
|
||||
|
||||
public:
|
||||
SwigDirector_UnaryFunction1DUnsigned(PyObject *self);
|
||||
@@ -489,7 +489,7 @@ private:
|
||||
};
|
||||
|
||||
|
||||
class SwigDirector_UnaryFunction1DFloat : public UnaryFunction1D< float >, public Swig::Director {
|
||||
class SwigDirector_UnaryFunction1DFloat : public UnaryFunction1D<float >, public Swig::Director {
|
||||
|
||||
public:
|
||||
SwigDirector_UnaryFunction1DFloat(PyObject *self);
|
||||
@@ -536,7 +536,7 @@ private:
|
||||
};
|
||||
|
||||
|
||||
class SwigDirector_UnaryFunction1DDouble : public UnaryFunction1D< double >, public Swig::Director {
|
||||
class SwigDirector_UnaryFunction1DDouble : public UnaryFunction1D<double >, public Swig::Director {
|
||||
|
||||
public:
|
||||
SwigDirector_UnaryFunction1DDouble(PyObject *self);
|
||||
@@ -583,14 +583,14 @@ private:
|
||||
};
|
||||
|
||||
|
||||
class SwigDirector_UnaryFunction1DVec2f : public UnaryFunction1D< Geometry::Vec2f >, public Swig::Director {
|
||||
class SwigDirector_UnaryFunction1DVec2f : public UnaryFunction1D<Geometry::Vec2f >, public Swig::Director {
|
||||
|
||||
public:
|
||||
SwigDirector_UnaryFunction1DVec2f(PyObject *self);
|
||||
SwigDirector_UnaryFunction1DVec2f(PyObject *self, IntegrationType iType);
|
||||
virtual ~SwigDirector_UnaryFunction1DVec2f();
|
||||
virtual std::string getName() const;
|
||||
virtual VecMat::Vec2< float > operator ()(Interface1D &inter);
|
||||
virtual VecMat::Vec2<float > operator ()(Interface1D &inter);
|
||||
|
||||
|
||||
/* Internal Director utilities */
|
||||
@@ -630,14 +630,14 @@ private:
|
||||
};
|
||||
|
||||
|
||||
class SwigDirector_UnaryFunction1DVec3f : public UnaryFunction1D< Geometry::Vec3f >, public Swig::Director {
|
||||
class SwigDirector_UnaryFunction1DVec3f : public UnaryFunction1D<Geometry::Vec3f >, public Swig::Director {
|
||||
|
||||
public:
|
||||
SwigDirector_UnaryFunction1DVec3f(PyObject *self);
|
||||
SwigDirector_UnaryFunction1DVec3f(PyObject *self, IntegrationType iType);
|
||||
virtual ~SwigDirector_UnaryFunction1DVec3f();
|
||||
virtual std::string getName() const;
|
||||
virtual VecMat::Vec3< float > operator ()(Interface1D &inter);
|
||||
virtual VecMat::Vec3<float > operator ()(Interface1D &inter);
|
||||
|
||||
|
||||
/* Internal Director utilities */
|
||||
|
||||
@@ -132,11 +132,11 @@ void FEdgeXDetector::preProcessFace(WXFace *iFace){
|
||||
Vec3r V(_Viewpoint - firstPoint);
|
||||
N.normalize();
|
||||
V.normalize();
|
||||
iFace->SetDotP(N * V);
|
||||
iFace->setDotP(N * V);
|
||||
|
||||
// compute the distance between the face center and the viewpoint:
|
||||
Vec3r dist_vec(iFace->center() - _Viewpoint);
|
||||
iFace->SetZ(dist_vec.norm());
|
||||
iFace->setZ(dist_vec.norm());
|
||||
}
|
||||
|
||||
void FEdgeXDetector::computeCurvatures(WXVertex *vertex){
|
||||
@@ -257,7 +257,7 @@ void FEdgeXDetector::ProcessSilhouetteFace(WXFace *iFace)
|
||||
}
|
||||
}
|
||||
// Set the closest point id:
|
||||
faceLayer->SetClosestPointIndex(closestPointId);
|
||||
faceLayer->setClosestPointIndex(closestPointId);
|
||||
// Add this layer to the face:
|
||||
iFace->AddSmoothLayer(faceLayer);
|
||||
}
|
||||
@@ -281,9 +281,9 @@ void FEdgeXDetector::ProcessSilhouetteEdge(WXEdge *iEdge)
|
||||
return;
|
||||
iEdge->AddNature(Nature::SILHOUETTE);
|
||||
if(fB->front())
|
||||
iEdge->SetOrder(1);
|
||||
iEdge->setOrder(1);
|
||||
else
|
||||
iEdge->SetOrder(-1);
|
||||
iEdge->setOrder(-1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ public:
|
||||
virtual void buildSmoothEdges(WXShape* iShape);
|
||||
|
||||
/*! Sets the current viewpoint */
|
||||
inline void SetViewpoint(const Vec3r& ivp) {_Viewpoint = ivp;}
|
||||
inline void setViewpoint(const Vec3r& ivp) {_Viewpoint = ivp;}
|
||||
inline void enableRidgesAndValleysFlag(bool b) {_computeRidgesAndValleys = b;}
|
||||
inline void enableSuggestiveContours(bool b) {_computeSuggestiveContours = b;}
|
||||
/*! Sets the radius of the geodesic sphere around each vertex (for the curvature computation)
|
||||
@@ -120,7 +120,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
inline void SetProgressBar(ProgressBar *iProgressBar) {_pProgressBar = iProgressBar;}
|
||||
inline void setProgressBar(ProgressBar *iProgressBar) {_pProgressBar = iProgressBar;}
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
@@ -240,9 +240,9 @@ public:
|
||||
|
||||
/*! modifiers */
|
||||
/*! Sets the 3D coordinates of the SVertex. */
|
||||
inline void SetPoint3D(const Vec3r &iPoint3D) {_Point3D = iPoint3D;}
|
||||
inline void setPoint3D(const Vec3r &iPoint3D) {_Point3D = iPoint3D;}
|
||||
/*! Sets the 3D projected coordinates of the SVertex. */
|
||||
inline void SetPoint2D(const Vec3r &iPoint2D) {_Point2D = iPoint2D;}
|
||||
inline void setPoint2D(const Vec3r &iPoint2D) {_Point2D = iPoint2D;}
|
||||
/*! Adds a normal to the Svertex's set of normals. If the same
|
||||
* normal is already in the set, nothing changes.
|
||||
*/
|
||||
@@ -266,10 +266,10 @@ public:
|
||||
const Vec2r directionFredo () {return _directionFredo;}
|
||||
|
||||
/*! Sets the Id */
|
||||
inline void SetId(const Id& id) {_Id = id;}
|
||||
inline void SetFEdges(const vector<FEdge*>& iFEdges) {_FEdges = iFEdges;}
|
||||
inline void SetShape(SShape *iShape) {_Shape = iShape;}
|
||||
inline void SetViewVertex(ViewVertex *iViewVertex) {_pViewVertex = iViewVertex;}
|
||||
inline void setId(const Id& id) {_Id = id;}
|
||||
inline void setFEdges(const vector<FEdge*>& iFEdges) {_FEdges = iFEdges;}
|
||||
inline void setShape(SShape *iShape) {_Shape = iShape;}
|
||||
inline void setViewVertex(ViewVertex *iViewVertex) {_pViewVertex = iViewVertex;}
|
||||
/*! Add an FEdge to the list of edges emanating from this SVertex. */
|
||||
inline void AddFEdge(FEdge* iFEdge) {_FEdges.push_back(iFEdge);}
|
||||
/* replaces edge 1 by edge 2 in the list of edges */
|
||||
@@ -501,30 +501,30 @@ public:
|
||||
|
||||
/* modifiers */
|
||||
/*! Sets the first SVertex. */
|
||||
inline void SetVertexA(SVertex *vA) {_VertexA = vA;}
|
||||
inline void setVertexA(SVertex *vA) {_VertexA = vA;}
|
||||
/*! Sets the second SVertex. */
|
||||
inline void SetVertexB(SVertex *vB) {_VertexB = vB;}
|
||||
inline void setVertexB(SVertex *vB) {_VertexB = vB;}
|
||||
/*! Sets the FEdge Id . */
|
||||
inline void SetId(const Id& id) {_Id = id;}
|
||||
inline void setId(const Id& id) {_Id = id;}
|
||||
/*! Sets the pointer to the next FEdge. */
|
||||
inline void SetNextEdge(FEdge* iEdge) {_NextEdge = iEdge;}
|
||||
inline void setNextEdge(FEdge* iEdge) {_NextEdge = iEdge;}
|
||||
/*! Sets the pointer to the previous FEdge. */
|
||||
inline void SetPreviousEdge(FEdge *iEdge) {_PreviousEdge = iEdge;}
|
||||
inline void setPreviousEdge(FEdge *iEdge) {_PreviousEdge = iEdge;}
|
||||
/*! Sets the nature of this FEdge. */
|
||||
inline void SetNature(Nature::EdgeNature iNature) {_Nature = iNature;}
|
||||
inline void setNature(Nature::EdgeNature iNature) {_Nature = iNature;}
|
||||
//inline void AddOccluder(Polygon3r& iPolygon) {_Occluders.push_back(iPolygon);}
|
||||
/*! Sets the ViewEdge to which this FEdge belongs to. */
|
||||
inline void SetViewEdge(ViewEdge *iViewEdge) {_ViewEdge = iViewEdge;}
|
||||
// inline void SetHasVisibilityPoint(bool iBool) {_hasVisibilityPoint = iBool;}
|
||||
// inline void SetVisibilityPointA(const Vec3r& iPoint) {_VisibilityPointA = iPoint;}
|
||||
// inline void SetVisibilityPointB(const Vec3r& iPoint) {_VisibilityPointB = iPoint;}
|
||||
inline void SetaFace(Polygon3r& iFace) {_aFace = iFace;}
|
||||
inline void SetOccludeeIntersection(const Vec3r& iPoint) {_occludeeIntersection = iPoint;}
|
||||
inline void SetOccludeeEmpty(bool iempty) {_occludeeEmpty = iempty;}
|
||||
inline void setViewEdge(ViewEdge *iViewEdge) {_ViewEdge = iViewEdge;}
|
||||
// inline void setHasVisibilityPoint(bool iBool) {_hasVisibilityPoint = iBool;}
|
||||
// inline void setVisibilityPointA(const Vec3r& iPoint) {_VisibilityPointA = iPoint;}
|
||||
// inline void setVisibilityPointB(const Vec3r& iPoint) {_VisibilityPointB = iPoint;}
|
||||
inline void setaFace(Polygon3r& iFace) {_aFace = iFace;}
|
||||
inline void setOccludeeIntersection(const Vec3r& iPoint) {_occludeeIntersection = iPoint;}
|
||||
inline void setOccludeeEmpty(bool iempty) {_occludeeEmpty = iempty;}
|
||||
/*! Sets the flag telling whether this FEdge is smooth or sharp.
|
||||
* true for Smooth, false for Sharp.
|
||||
*/
|
||||
inline void SetSmooth(bool iFlag) {_isSmooth = iFlag;}
|
||||
inline void setSmooth(bool iFlag) {_isSmooth = iFlag;}
|
||||
|
||||
/* checks whether two FEdge have a common vertex.
|
||||
* Returns a pointer on the common vertex if it exists,
|
||||
@@ -840,13 +840,13 @@ public:
|
||||
const Material& bMaterial() const ;
|
||||
|
||||
/*! Sets the normal to the face lying on the right of the FEdge. */
|
||||
inline void SetNormalA(const Vec3r& iNormal) {_aNormal = iNormal;}
|
||||
inline void setNormalA(const Vec3r& iNormal) {_aNormal = iNormal;}
|
||||
/*! Sets the normal to the face lying on the left of the FEdge. */
|
||||
inline void SetNormalB(const Vec3r& iNormal) {_bNormal = iNormal;}
|
||||
inline void setNormalB(const Vec3r& iNormal) {_bNormal = iNormal;}
|
||||
/*! Sets the index of the material lying on the right of the FEdge.*/
|
||||
inline void SetaMaterialIndex(unsigned i) {_aMaterialIndex = i;}
|
||||
inline void setaMaterialIndex(unsigned i) {_aMaterialIndex = i;}
|
||||
/*! Sets the index of the material lying on the left of the FEdge.*/
|
||||
inline void SetbMaterialIndex(unsigned i) {_bMaterialIndex = i;}
|
||||
inline void setbMaterialIndex(unsigned i) {_bMaterialIndex = i;}
|
||||
|
||||
};
|
||||
|
||||
@@ -901,11 +901,11 @@ public:
|
||||
/*! Returns the material of the face it is running accross. */
|
||||
const Material& material() const ;
|
||||
|
||||
inline void SetFace(void * iFace) {_Face = iFace;}
|
||||
inline void setFace(void * iFace) {_Face = iFace;}
|
||||
/*! Sets the normal to the Face it is running accross. */
|
||||
inline void SetNormal(const Vec3r& iNormal) {_Normal = iNormal;}
|
||||
inline void setNormal(const Vec3r& iNormal) {_Normal = iNormal;}
|
||||
/*! Sets the index of the material of the face it is running accross. */
|
||||
inline void SetMaterialIndex(unsigned i) {_MaterialIndex = i;}
|
||||
inline void setMaterialIndex(unsigned i) {_MaterialIndex = i;}
|
||||
};
|
||||
/**********************************/
|
||||
/* */
|
||||
@@ -969,7 +969,7 @@ public:
|
||||
sv++)
|
||||
{
|
||||
SVertex *newv = new SVertex(*(*sv));
|
||||
newv->SetShape(this);
|
||||
newv->setShape(this);
|
||||
_verticesList.push_back(newv);
|
||||
}
|
||||
|
||||
@@ -1015,7 +1015,7 @@ public:
|
||||
FEdge *current = *fed;
|
||||
newfedgelist.push_back((FEdge*)current->userdata);
|
||||
}
|
||||
(*sv)->SetFEdges(newfedgelist);
|
||||
(*sv)->setFEdges(newfedgelist);
|
||||
}
|
||||
|
||||
//-------------------------------------
|
||||
@@ -1025,10 +1025,10 @@ public:
|
||||
e!=eend;
|
||||
e++)
|
||||
{
|
||||
(*e)->SetVertexA((SVertex*)((*e)->vertexA()->userdata));
|
||||
(*e)->SetVertexB((SVertex*)((*e)->vertexB()->userdata));
|
||||
(*e)->SetNextEdge((FEdge*)((*e)->nextEdge()->userdata));
|
||||
(*e)->SetPreviousEdge((FEdge*)((*e)->previousEdge()->userdata));
|
||||
(*e)->setVertexA((SVertex*)((*e)->vertexA()->userdata));
|
||||
(*e)->setVertexB((SVertex*)((*e)->vertexB()->userdata));
|
||||
(*e)->setNextEdge((FEdge*)((*e)->nextEdge()->userdata));
|
||||
(*e)->setPreviousEdge((FEdge*)((*e)->previousEdge()->userdata));
|
||||
}
|
||||
|
||||
|
||||
@@ -1104,7 +1104,7 @@ public:
|
||||
/*! Adds a SVertex to the list of SVertex of this Shape.
|
||||
* The SShape attribute of the SVertex is also set to 'this'.
|
||||
*/
|
||||
inline void AddNewVertex(SVertex* iv) {iv->SetShape(this);_verticesList.push_back(iv);}
|
||||
inline void AddNewVertex(SVertex* iv) {iv->setShape(this);_verticesList.push_back(iv);}
|
||||
inline void AddChain(FEdge *iEdge){
|
||||
_chains.push_back(iEdge);
|
||||
}
|
||||
@@ -1112,7 +1112,7 @@ public:
|
||||
inline SVertex * CreateSVertex(const Vec3r& P3D, const Vec3r& P2D, const Id& id)
|
||||
{
|
||||
SVertex *Ia = new SVertex(P3D, id);
|
||||
Ia->SetPoint2D(P2D);
|
||||
Ia->setPoint2D(P2D);
|
||||
AddNewVertex(Ia);
|
||||
return Ia;
|
||||
}
|
||||
@@ -1172,7 +1172,7 @@ public:
|
||||
// create new SVertex:
|
||||
// (we keep B's id)
|
||||
SVertex* newVertex = new SVertex(newpoint3d, ioB->getId());
|
||||
newVertex->SetPoint2D(newpoint2d);
|
||||
newVertex->setPoint2D(newpoint2d);
|
||||
|
||||
// Add this vertex to the intersections list:
|
||||
intersections.push_back(newVertex);
|
||||
@@ -1192,23 +1192,23 @@ public:
|
||||
// AB becomes (address speaking) AA'. B is updated.
|
||||
//--------------------------------------------------
|
||||
// The edge AB becomes edge AA'.
|
||||
(fe)->SetVertexB((*sv));
|
||||
(fe)->setVertexB((*sv));
|
||||
// a new edge, A'B is created.
|
||||
FEdge *newEdge;
|
||||
if(fe->isSmooth()){
|
||||
newEdge = new FEdgeSmooth((*sv), svB);
|
||||
FEdgeSmooth * se = dynamic_cast<FEdgeSmooth*>(newEdge);
|
||||
FEdgeSmooth * fes = dynamic_cast<FEdgeSmooth*>(fe);
|
||||
se->SetMaterialIndex(fes->materialIndex());
|
||||
se->setMaterialIndex(fes->materialIndex());
|
||||
}else{
|
||||
newEdge = new FEdgeSharp((*sv), svB);
|
||||
FEdgeSharp * se = dynamic_cast<FEdgeSharp*>(newEdge);
|
||||
FEdgeSharp * fes = dynamic_cast<FEdgeSharp*>(fe);
|
||||
se->SetaMaterialIndex(fes->aMaterialIndex());
|
||||
se->SetbMaterialIndex(fes->bMaterialIndex());
|
||||
se->setaMaterialIndex(fes->aMaterialIndex());
|
||||
se->setbMaterialIndex(fes->bMaterialIndex());
|
||||
}
|
||||
|
||||
newEdge->SetNature((fe)->getNature());
|
||||
newEdge->setNature((fe)->getNature());
|
||||
|
||||
|
||||
// to build a new chain:
|
||||
@@ -1219,15 +1219,15 @@ public:
|
||||
ioNewEdges.push_back(newEdge);
|
||||
|
||||
// update edge A'B for the next pointing edge
|
||||
newEdge->SetNextEdge((fe)->nextEdge());
|
||||
fe->nextEdge()->SetPreviousEdge(newEdge);
|
||||
newEdge->setNextEdge((fe)->nextEdge());
|
||||
fe->nextEdge()->setPreviousEdge(newEdge);
|
||||
Id id(fe->getId().getFirst(), fe->getId().getSecond()+1);
|
||||
newEdge->SetId(fe->getId());
|
||||
fe->SetId(id);
|
||||
newEdge->setId(fe->getId());
|
||||
fe->setId(id);
|
||||
|
||||
// update edge AA' for the next pointing edge
|
||||
//ioEdge->SetNextEdge(newEdge);
|
||||
(fe)->SetNextEdge(NULL);
|
||||
//ioEdge->setNextEdge(newEdge);
|
||||
(fe)->setNextEdge(NULL);
|
||||
|
||||
// update vertex pointing edges list:
|
||||
// -- vertex B --
|
||||
@@ -1264,30 +1264,30 @@ public:
|
||||
newEdge = new FEdgeSmooth(ioNewVertex, B);
|
||||
FEdgeSmooth * se = dynamic_cast<FEdgeSmooth*>(newEdge);
|
||||
FEdgeSmooth * fes = dynamic_cast<FEdgeSmooth*>(ioEdge);
|
||||
se->SetMaterialIndex(fes->materialIndex());
|
||||
se->setMaterialIndex(fes->materialIndex());
|
||||
}else{
|
||||
newEdge = new FEdgeSharp(ioNewVertex, B);
|
||||
FEdgeSharp * se = dynamic_cast<FEdgeSharp*>(newEdge);
|
||||
FEdgeSharp * fes = dynamic_cast<FEdgeSharp*>(ioEdge);
|
||||
se->SetaMaterialIndex(fes->aMaterialIndex());
|
||||
se->SetbMaterialIndex(fes->bMaterialIndex());
|
||||
se->setaMaterialIndex(fes->aMaterialIndex());
|
||||
se->setbMaterialIndex(fes->bMaterialIndex());
|
||||
}
|
||||
newEdge->SetNature(ioEdge->getNature());
|
||||
newEdge->setNature(ioEdge->getNature());
|
||||
|
||||
|
||||
if(ioEdge->nextEdge() != 0)
|
||||
ioEdge->nextEdge()->SetPreviousEdge(newEdge);
|
||||
ioEdge->nextEdge()->setPreviousEdge(newEdge);
|
||||
|
||||
// update edge A'B for the next pointing edge
|
||||
newEdge->SetNextEdge(ioEdge->nextEdge());
|
||||
newEdge->setNextEdge(ioEdge->nextEdge());
|
||||
// update edge A'B for the previous pointing edge
|
||||
newEdge->SetPreviousEdge(0); // because it is now a TVertex
|
||||
newEdge->setPreviousEdge(0); // because it is now a TVertex
|
||||
Id id(ioEdge->getId().getFirst(), ioEdge->getId().getSecond()+1);
|
||||
newEdge->SetId(ioEdge->getId());
|
||||
ioEdge->SetId(id);
|
||||
newEdge->setId(ioEdge->getId());
|
||||
ioEdge->setId(id);
|
||||
|
||||
// update edge AA' for the next pointing edge
|
||||
ioEdge->SetNextEdge(0); // because it is now a TVertex
|
||||
ioEdge->setNextEdge(0); // because it is now a TVertex
|
||||
|
||||
// update vertex pointing edges list:
|
||||
// -- vertex B --
|
||||
@@ -1301,17 +1301,17 @@ public:
|
||||
AddEdge(newEdge); // FIXME ??
|
||||
|
||||
// The edge AB becomes edge AA'.
|
||||
ioEdge->SetVertexB(ioNewVertex);
|
||||
ioEdge->setVertexB(ioNewVertex);
|
||||
|
||||
if(ioEdge->isSmooth()){
|
||||
((FEdgeSmooth*)newEdge)->SetFace(((FEdgeSmooth*)ioEdge)->face());
|
||||
((FEdgeSmooth*)newEdge)->setFace(((FEdgeSmooth*)ioEdge)->face());
|
||||
}
|
||||
|
||||
return newEdge;
|
||||
}
|
||||
|
||||
/*! Sets the Bounding Box of the Shape */
|
||||
inline void SetBBox(const BBox<Vec3r>& iBBox) {_BBox = iBBox;}
|
||||
inline void setBBox(const BBox<Vec3r>& iBBox) {_BBox = iBBox;}
|
||||
|
||||
/*! Compute the bbox of the sshape */
|
||||
inline void ComputeBBox()
|
||||
@@ -1359,7 +1359,7 @@ public:
|
||||
}
|
||||
|
||||
|
||||
SetBBox(BBox<Vec3r>(Vec3r(XMin, YMin, ZMin), Vec3r(XMax, YMax, ZMax)));
|
||||
setBBox(BBox<Vec3r>(Vec3r(XMin, YMin, ZMin), Vec3r(XMax, YMax, ZMax)));
|
||||
}
|
||||
|
||||
inline void RemoveEdgeFromChain(FEdge *iEdge)
|
||||
@@ -1409,11 +1409,11 @@ public:
|
||||
|
||||
/* Modififers */
|
||||
/*! Sets the Id of the shape.*/
|
||||
inline void SetId(Id id) {_Id = id;}
|
||||
inline void setId(Id id) {_Id = id;}
|
||||
/*! Sets the list of materials for the shape */
|
||||
inline void SetMaterials(const vector<Material>& iMaterials) {_Materials = iMaterials;}
|
||||
inline void SetViewShape(ViewShape *iShape) {_ViewShape = iShape;}
|
||||
inline void SetImportance(float importance){_importance = importance;}
|
||||
inline void setMaterials(const vector<Material>& iMaterials) {_Materials = iMaterials;}
|
||||
inline void setViewShape(ViewShape *iShape) {_ViewShape = iShape;}
|
||||
inline void setImportance(float importance){_importance = importance;}
|
||||
};
|
||||
|
||||
#endif // SILHOUETTE_H
|
||||
|
||||
@@ -55,7 +55,7 @@ real SilhouetteGeomEngine::_zfar = 100.0;
|
||||
|
||||
SilhouetteGeomEngine * SilhouetteGeomEngine::_pInstance = 0;
|
||||
|
||||
void SilhouetteGeomEngine::SetTransform(const real iModelViewMatrix[4][4], const real iProjectionMatrix[4][4], const int iViewport[4], real iFocal)
|
||||
void SilhouetteGeomEngine::setTransform(const real iModelViewMatrix[4][4], const real iProjectionMatrix[4][4], const int iViewport[4], real iFocal)
|
||||
{
|
||||
unsigned int i,j;
|
||||
_translation[0] = iModelViewMatrix[3][0];
|
||||
@@ -93,7 +93,7 @@ void SilhouetteGeomEngine::SetTransform(const real iModelViewMatrix[4][4], const
|
||||
_Focal = iFocal;
|
||||
}
|
||||
|
||||
void SilhouetteGeomEngine::SetFrustum(real iZNear, real iZFar)
|
||||
void SilhouetteGeomEngine::setFrustum(real iZNear, real iZFar)
|
||||
{
|
||||
_znear = iZNear;
|
||||
_zfar = iZFar;
|
||||
@@ -117,7 +117,7 @@ void SilhouetteGeomEngine::ProjectSilhouette(vector<SVertex*>& ioVertices)
|
||||
{
|
||||
GeomUtils::fromWorldToImage((*sv)->point3D(), newPoint, _modelViewMatrix, _projectionMatrix, _viewport);
|
||||
newPoint[2] = (-newPoint[2]-_znear)/(_zfar-_znear); // normalize Z between 0 and 1
|
||||
(*sv)->SetPoint2D(newPoint);
|
||||
(*sv)->setPoint2D(newPoint);
|
||||
//cerr << (*sv)->point2d().z() << " ";
|
||||
// real d=(*sv)->point2d()[2];
|
||||
// if (d>max) max =d;
|
||||
@@ -128,7 +128,7 @@ void SilhouetteGeomEngine::ProjectSilhouette(vector<SVertex*>& ioVertices)
|
||||
// sv++)
|
||||
// {
|
||||
// Vec3r P((*sv)->point2d());
|
||||
// (*sv)->SetPoint2D(Vec3r(P[0], P[1], 1.0-(P[2]-min)/(max-min)));
|
||||
// (*sv)->setPoint2D(Vec3r(P[0], P[1], 1.0-(P[2]-min)/(max-min)));
|
||||
// //cerr<<(*sv)->point2d()[2]<<" ";
|
||||
// }
|
||||
}
|
||||
@@ -141,7 +141,7 @@ void SilhouetteGeomEngine::ProjectSilhouette(SVertex* ioVertex)
|
||||
vector<SVertex*>::iterator sv, svend;
|
||||
GeomUtils::fromWorldToImage(ioVertex->point3D(), newPoint, _modelViewMatrix, _projectionMatrix, _viewport);
|
||||
newPoint[2] = (-newPoint[2]-_znear)/(_zfar-_znear); // normalize Z between 0 and 1
|
||||
ioVertex->SetPoint2D(newPoint);
|
||||
ioVertex->setPoint2D(newPoint);
|
||||
}
|
||||
|
||||
real SilhouetteGeomEngine::ImageToWorldParameter(FEdge *fe, real t)
|
||||
|
||||
@@ -75,7 +75,7 @@ public:
|
||||
}
|
||||
|
||||
/*! Sets the current viewpoint */
|
||||
static inline void SetViewpoint(const Vec3r& ivp) {_Viewpoint = ivp;}
|
||||
static inline void setViewpoint(const Vec3r& ivp) {_Viewpoint = ivp;}
|
||||
|
||||
/*! Sets the current transformation
|
||||
* iModelViewMatrix
|
||||
@@ -87,11 +87,11 @@ public:
|
||||
* iFocal
|
||||
* The focal length
|
||||
*/
|
||||
static void SetTransform(const real iModelViewMatrix[4][4], const real iProjectionMatrix[4][4], const int iViewport[4], real iFocal) ;
|
||||
static void setTransform(const real iModelViewMatrix[4][4], const real iProjectionMatrix[4][4], const int iViewport[4], real iFocal) ;
|
||||
|
||||
/*! Sets the current znear and zfar
|
||||
*/
|
||||
static void SetFrustum(real iZNear, real iZFar) ;
|
||||
static void setFrustum(real iZNear, real iZFar) ;
|
||||
|
||||
/* accessors */
|
||||
static void retrieveViewport(int viewport[4]);
|
||||
|
||||
@@ -160,7 +160,7 @@ ViewEdge * ViewEdgeXBuilder::BuildSmoothViewEdge(const OWXFaceLayer& iFaceLayer)
|
||||
|
||||
// Start a new chain edges
|
||||
ViewEdge * newVEdge = new ViewEdge;
|
||||
newVEdge->SetId(_currentViewId);
|
||||
newVEdge->setId(_currentViewId);
|
||||
++_currentViewId;
|
||||
|
||||
_pCurrentVShape->AddEdge(newVEdge);
|
||||
@@ -174,23 +174,23 @@ ViewEdge * ViewEdgeXBuilder::BuildSmoothViewEdge(const OWXFaceLayer& iFaceLayer)
|
||||
fl!=flend;
|
||||
++fl){
|
||||
fe = BuildSmoothFEdge(feprevious, (*fl));
|
||||
fe->SetViewEdge(newVEdge);
|
||||
fe->setViewEdge(newVEdge);
|
||||
if(!fefirst)
|
||||
fefirst = fe;
|
||||
feprevious = fe;
|
||||
}
|
||||
// Store the chain starting edge:
|
||||
_pCurrentSShape->AddChain(fefirst);
|
||||
newVEdge->SetNature(iFaceLayer.fl->nature());
|
||||
newVEdge->SetFEdgeA(fefirst);
|
||||
newVEdge->SetFEdgeB(fe);
|
||||
newVEdge->setNature(iFaceLayer.fl->nature());
|
||||
newVEdge->setFEdgeA(fefirst);
|
||||
newVEdge->setFEdgeB(fe);
|
||||
|
||||
// is it a closed loop ?
|
||||
if((first == end) && (size != 1)){
|
||||
fefirst->SetPreviousEdge(fe);
|
||||
fe->SetNextEdge(fefirst);
|
||||
newVEdge->SetA(0);
|
||||
newVEdge->SetB(0);
|
||||
fefirst->setPreviousEdge(fe);
|
||||
fe->setNextEdge(fefirst);
|
||||
newVEdge->setA(0);
|
||||
newVEdge->setB(0);
|
||||
}else{
|
||||
ViewVertex *vva = MakeViewVertex(fefirst->vertexA());
|
||||
ViewVertex *vvb = MakeViewVertex(fe->vertexB());
|
||||
@@ -198,8 +198,8 @@ ViewEdge * ViewEdgeXBuilder::BuildSmoothViewEdge(const OWXFaceLayer& iFaceLayer)
|
||||
((NonTVertex*)vva)->AddOutgoingViewEdge(newVEdge);
|
||||
((NonTVertex*)vvb)->AddIncomingViewEdge(newVEdge);
|
||||
|
||||
newVEdge->SetA(vva);
|
||||
newVEdge->SetB(vvb);
|
||||
newVEdge->setA(vva);
|
||||
newVEdge->setB(vvb);
|
||||
}
|
||||
|
||||
return newVEdge;
|
||||
@@ -208,7 +208,7 @@ ViewEdge * ViewEdgeXBuilder::BuildSmoothViewEdge(const OWXFaceLayer& iFaceLayer)
|
||||
ViewEdge * ViewEdgeXBuilder::BuildSharpViewEdge(const OWXEdge& iWEdge) {
|
||||
// Start a new sharp chain edges
|
||||
ViewEdge * newVEdge = new ViewEdge;
|
||||
newVEdge->SetId(_currentViewId);
|
||||
newVEdge->setId(_currentViewId);
|
||||
++_currentViewId;
|
||||
unsigned size=0;
|
||||
|
||||
@@ -248,23 +248,23 @@ ViewEdge * ViewEdgeXBuilder::BuildSharpViewEdge(const OWXEdge& iWEdge) {
|
||||
we!=weend;
|
||||
++we){
|
||||
fe = BuildSharpFEdge(feprevious, (*we));
|
||||
fe->SetViewEdge(newVEdge);
|
||||
fe->setViewEdge(newVEdge);
|
||||
if(!fefirst)
|
||||
fefirst = fe;
|
||||
feprevious = fe;
|
||||
}
|
||||
// Store the chain starting edge:
|
||||
_pCurrentSShape->AddChain(fefirst);
|
||||
newVEdge->SetNature(iWEdge.e->nature());
|
||||
newVEdge->SetFEdgeA(fefirst);
|
||||
newVEdge->SetFEdgeB(fe);
|
||||
newVEdge->setNature(iWEdge.e->nature());
|
||||
newVEdge->setFEdgeA(fefirst);
|
||||
newVEdge->setFEdgeB(fe);
|
||||
|
||||
// is it a closed loop ?
|
||||
if((firstWEdge == endWEdge) && (size!=1)){
|
||||
fefirst->SetPreviousEdge(fe);
|
||||
fe->SetNextEdge(fefirst);
|
||||
newVEdge->SetA(0);
|
||||
newVEdge->SetB(0);
|
||||
fefirst->setPreviousEdge(fe);
|
||||
fe->setNextEdge(fefirst);
|
||||
newVEdge->setA(0);
|
||||
newVEdge->setB(0);
|
||||
}else{
|
||||
ViewVertex *vva = MakeViewVertex(fefirst->vertexA());
|
||||
ViewVertex *vvb = MakeViewVertex(fe->vertexB());
|
||||
@@ -272,8 +272,8 @@ ViewEdge * ViewEdgeXBuilder::BuildSharpViewEdge(const OWXEdge& iWEdge) {
|
||||
((NonTVertex*)vva)->AddOutgoingViewEdge(newVEdge);
|
||||
((NonTVertex*)vvb)->AddIncomingViewEdge(newVEdge);
|
||||
|
||||
newVEdge->SetA(vva);
|
||||
newVEdge->SetB(vvb);
|
||||
newVEdge->setA(vva);
|
||||
newVEdge->setB(vvb);
|
||||
}
|
||||
|
||||
return newVEdge;
|
||||
@@ -468,14 +468,14 @@ FEdge * ViewEdgeXBuilder::BuildSmoothFEdge(FEdge *feprevious, const OWXFaceLayer
|
||||
|
||||
// Creates the corresponding feature edge
|
||||
fe = new FEdgeSmooth(va, vb);
|
||||
fe->SetNature(ifl.fl->nature());
|
||||
fe->SetId(_currentFId);
|
||||
fe->SetMaterialIndex(ifl.fl->getFace()->materialIndex());
|
||||
fe->SetFace(ifl.fl->getFace());
|
||||
fe->SetNormal(normal);
|
||||
fe->SetPreviousEdge(feprevious);
|
||||
fe->setNature(ifl.fl->nature());
|
||||
fe->setId(_currentFId);
|
||||
fe->setMaterialIndex(ifl.fl->getFace()->materialIndex());
|
||||
fe->setFace(ifl.fl->getFace());
|
||||
fe->setNormal(normal);
|
||||
fe->setPreviousEdge(feprevious);
|
||||
if(feprevious)
|
||||
feprevious->SetNextEdge(fe);
|
||||
feprevious->setNextEdge(fe);
|
||||
_pCurrentSShape->AddEdge(fe);
|
||||
va->AddFEdge(fe);
|
||||
vb->AddFEdge(fe);
|
||||
@@ -603,15 +603,15 @@ FEdge * ViewEdgeXBuilder::BuildSharpFEdge(FEdge *feprevious, const OWXEdge& iwe)
|
||||
// Creates the corresponding feature edge
|
||||
// Creates the corresponding feature edge
|
||||
fe = new FEdgeSharp(va, vb);
|
||||
fe->SetNature(iwe.e->nature());
|
||||
fe->SetId(_currentFId);
|
||||
fe->SetaMaterialIndex(matA);
|
||||
fe->SetbMaterialIndex(matB);
|
||||
fe->SetNormalA(normalA);
|
||||
fe->SetNormalB(normalB);
|
||||
fe->SetPreviousEdge(feprevious);
|
||||
fe->setNature(iwe.e->nature());
|
||||
fe->setId(_currentFId);
|
||||
fe->setaMaterialIndex(matA);
|
||||
fe->setbMaterialIndex(matB);
|
||||
fe->setNormalA(normalA);
|
||||
fe->setNormalB(normalB);
|
||||
fe->setPreviousEdge(feprevious);
|
||||
if(feprevious)
|
||||
feprevious->SetNextEdge(fe);
|
||||
feprevious->setNextEdge(fe);
|
||||
_pCurrentSShape->AddEdge(fe);
|
||||
va->AddFEdge(fe);
|
||||
vb->AddFEdge(fe);
|
||||
|
||||
@@ -175,9 +175,9 @@ public:
|
||||
inline int currentFId() const { return _currentFId; }
|
||||
inline int currentSVertexId() const { return _currentSVertexId; }
|
||||
/*! modifiers */
|
||||
inline void SetCurrentViewId(int id) { _currentViewId = id; }
|
||||
inline void SetCurrentFId(int id) { _currentFId = id; }
|
||||
inline void SetCurrentSVertexId(int id) { _currentSVertexId = id; }
|
||||
inline void setCurrentViewId(int id) { _currentViewId = id; }
|
||||
inline void setCurrentFId(int id) { _currentFId = id; }
|
||||
inline void setCurrentSVertexId(int id) { _currentSVertexId = id; }
|
||||
|
||||
protected:
|
||||
/*! Init the view edges building */
|
||||
|
||||
@@ -144,7 +144,7 @@ TVertex* ViewMap::CreateTVertex(const Vec3r& iA3D, const Vec3r& iA2D, FEdge *iFE
|
||||
else
|
||||
tvertex = new TVertex(Ib,Ia);
|
||||
|
||||
tvertex->SetId(id);
|
||||
tvertex->setId(id);
|
||||
|
||||
// add these vertices to the view map
|
||||
AddViewVertex(tvertex);
|
||||
@@ -191,18 +191,18 @@ ViewVertex * ViewMap::InsertViewVertex(SVertex *iVertex,
|
||||
// a new VEdge
|
||||
if(ioEdge->A() == 0){
|
||||
// closed loop
|
||||
ioEdge->SetA(vva);
|
||||
ioEdge->SetB(vva);
|
||||
ioEdge->setA(vva);
|
||||
ioEdge->setB(vva);
|
||||
// update sshape
|
||||
vshape->sshape()->RemoveEdgeFromChain(ioEdge->fedgeA());
|
||||
vshape->sshape()->RemoveEdgeFromChain(ioEdge->fedgeB());
|
||||
|
||||
ioEdge->SetFEdgeA(fbegin);
|
||||
ioEdge->SetFEdgeB(fend);
|
||||
ioEdge->setFEdgeA(fbegin);
|
||||
ioEdge->setFEdgeB(fend);
|
||||
|
||||
// Update FEdges
|
||||
fend->SetNextEdge(0);
|
||||
fbegin->SetPreviousEdge(0);
|
||||
fend->setNextEdge(0);
|
||||
fbegin->setPreviousEdge(0);
|
||||
|
||||
// update new View Vertex:
|
||||
vva->AddOutgoingViewEdge(ioEdge);
|
||||
@@ -213,16 +213,16 @@ ViewVertex * ViewMap::InsertViewVertex(SVertex *iVertex,
|
||||
}else{
|
||||
// Create new ViewEdge
|
||||
ViewEdge * newVEdge = new ViewEdge(vva, ioEdge->B(), fbegin, ioEdge->fedgeB(), vshape);
|
||||
newVEdge->SetId(Id(ioEdge->getId().getFirst(), ioEdge->getId().getSecond()+1));
|
||||
newVEdge->SetNature(ioEdge->getNature());
|
||||
newVEdge->setId(Id(ioEdge->getId().getFirst(), ioEdge->getId().getSecond()+1));
|
||||
newVEdge->setNature(ioEdge->getNature());
|
||||
//newVEdge->UpdateFEdges(); // done in the ViewEdge constructor
|
||||
// Update old ViewEdge
|
||||
ioEdge->SetB(vva);
|
||||
ioEdge->SetFEdgeB(fend);
|
||||
ioEdge->setB(vva);
|
||||
ioEdge->setFEdgeB(fend);
|
||||
|
||||
// Update FEdges
|
||||
fend->SetNextEdge(0);
|
||||
fbegin->SetPreviousEdge(0);
|
||||
fend->setNextEdge(0);
|
||||
fbegin->setPreviousEdge(0);
|
||||
|
||||
// update new View Vertex:
|
||||
vva->AddOutgoingViewEdge(newVEdge);
|
||||
@@ -291,9 +291,9 @@ bool ViewEdgeComp(ViewVertex::directedViewEdge& dve1, ViewVertex::directedViewEd
|
||||
}
|
||||
return false;
|
||||
}
|
||||
void TVertex::SetFrontEdgeA(ViewEdge *iFrontEdgeA, bool incoming) {
|
||||
void TVertex::setFrontEdgeA(ViewEdge *iFrontEdgeA, bool incoming) {
|
||||
if (!iFrontEdgeA) {
|
||||
cerr << "Warning: null pointer passed as argument of TVertex::SetFrontEdgeA()" << endl;
|
||||
cerr << "Warning: null pointer passed as argument of TVertex::setFrontEdgeA()" << endl;
|
||||
return;
|
||||
}
|
||||
_FrontEdgeA = directedViewEdge(iFrontEdgeA, incoming);
|
||||
@@ -307,9 +307,9 @@ void TVertex::SetFrontEdgeA(ViewEdge *iFrontEdgeA, bool incoming) {
|
||||
else
|
||||
_sortedEdges.push_back(&_FrontEdgeA);
|
||||
}
|
||||
void TVertex::SetFrontEdgeB(ViewEdge *iFrontEdgeB, bool incoming) {
|
||||
void TVertex::setFrontEdgeB(ViewEdge *iFrontEdgeB, bool incoming) {
|
||||
if (!iFrontEdgeB) {
|
||||
cerr << "Warning: null pointer passed as argument of TVertex::SetFrontEdgeB()" << endl;
|
||||
cerr << "Warning: null pointer passed as argument of TVertex::setFrontEdgeB()" << endl;
|
||||
return;
|
||||
}
|
||||
_FrontEdgeB = directedViewEdge(iFrontEdgeB, incoming);
|
||||
@@ -323,9 +323,9 @@ void TVertex::SetFrontEdgeB(ViewEdge *iFrontEdgeB, bool incoming) {
|
||||
else
|
||||
_sortedEdges.push_back(&_FrontEdgeB);
|
||||
}
|
||||
void TVertex::SetBackEdgeA(ViewEdge *iBackEdgeA, bool incoming) {
|
||||
void TVertex::setBackEdgeA(ViewEdge *iBackEdgeA, bool incoming) {
|
||||
if (!iBackEdgeA) {
|
||||
cerr << "Warning: null pointer passed as argument of TVertex::SetBackEdgeA()" << endl;
|
||||
cerr << "Warning: null pointer passed as argument of TVertex::setBackEdgeA()" << endl;
|
||||
return;
|
||||
}
|
||||
_BackEdgeA = directedViewEdge(iBackEdgeA, incoming);
|
||||
@@ -339,9 +339,9 @@ void TVertex::SetBackEdgeA(ViewEdge *iBackEdgeA, bool incoming) {
|
||||
else
|
||||
_sortedEdges.push_back(&_BackEdgeA);
|
||||
}
|
||||
void TVertex::SetBackEdgeB(ViewEdge *iBackEdgeB, bool incoming) {
|
||||
void TVertex::setBackEdgeB(ViewEdge *iBackEdgeB, bool incoming) {
|
||||
if (!iBackEdgeB) {
|
||||
cerr << "Warning: null pointer passed as argument of TVertex::SetBackEdgeB()" << endl;
|
||||
cerr << "Warning: null pointer passed as argument of TVertex::setBackEdgeB()" << endl;
|
||||
return;
|
||||
}
|
||||
_BackEdgeB = directedViewEdge(iBackEdgeB, incoming);
|
||||
@@ -694,10 +694,10 @@ void ViewEdge::UpdateFEdges()
|
||||
FEdge *currentEdge = _FEdgeA;
|
||||
do
|
||||
{
|
||||
currentEdge->SetViewEdge(this);
|
||||
currentEdge->setViewEdge(this);
|
||||
currentEdge = currentEdge->nextEdge();
|
||||
}while((currentEdge != NULL) && (currentEdge!= _FEdgeB));
|
||||
// last one
|
||||
_FEdgeB->SetViewEdge(this);
|
||||
_FEdgeB->setViewEdge(this);
|
||||
|
||||
}
|
||||
|
||||
@@ -427,8 +427,8 @@ public:
|
||||
_FrontEdgeB.first = 0;
|
||||
_BackEdgeA.first = 0;
|
||||
_BackEdgeB.first = 0;
|
||||
svFront->SetViewVertex(this);
|
||||
svBack->SetViewVertex(this);
|
||||
svFront->setViewVertex(this);
|
||||
svBack->setViewVertex(this);
|
||||
}
|
||||
|
||||
protected:
|
||||
@@ -465,15 +465,15 @@ public:
|
||||
|
||||
/* modifiers */
|
||||
/*! Sets the SVertex that is closer to the viewpoint. */
|
||||
inline void SetFrontVertex(SVertex *iFrontSVertex) {_FrontSVertex = iFrontSVertex;_FrontSVertex->SetViewVertex(this);}
|
||||
inline void setFrontVertex(SVertex *iFrontSVertex) {_FrontSVertex = iFrontSVertex;_FrontSVertex->setViewVertex(this);}
|
||||
/*! Sets the SVertex that is further away from the viewpoint. */
|
||||
inline void SetBackSVertex(SVertex *iBackSVertex) {_BackSVertex = iBackSVertex;_BackSVertex->SetViewVertex(this);}
|
||||
void SetFrontEdgeA(ViewEdge *iFrontEdgeA, bool incoming=true);
|
||||
void SetFrontEdgeB(ViewEdge *iFrontEdgeB, bool incoming=true) ;
|
||||
void SetBackEdgeA(ViewEdge *iBackEdgeA, bool incoming=true);
|
||||
void SetBackEdgeB(ViewEdge *iBackEdgeB, bool incoming=true) ;
|
||||
inline void setBackSVertex(SVertex *iBackSVertex) {_BackSVertex = iBackSVertex;_BackSVertex->setViewVertex(this);}
|
||||
void setFrontEdgeA(ViewEdge *iFrontEdgeA, bool incoming=true);
|
||||
void setFrontEdgeB(ViewEdge *iFrontEdgeB, bool incoming=true) ;
|
||||
void setBackEdgeA(ViewEdge *iBackEdgeA, bool incoming=true);
|
||||
void setBackEdgeB(ViewEdge *iBackEdgeB, bool incoming=true) ;
|
||||
/*! Sets the Id. */
|
||||
inline void SetId(const Id& iId) {_Id = iId;}
|
||||
inline void setId(const Id& iId) {_Id = iId;}
|
||||
|
||||
/*! Returns the SVertex (among the 2) belonging to the FEdge iFEdge */
|
||||
inline SVertex * GetSVertex(FEdge *iFEdge)
|
||||
@@ -641,7 +641,7 @@ public:
|
||||
inline NonTVertex(SVertex* iSVertex) : ViewVertex(Nature::NON_T_VERTEX)
|
||||
{
|
||||
_SVertex = iSVertex;
|
||||
_SVertex->SetViewVertex(this);
|
||||
_SVertex->setViewVertex(this);
|
||||
}
|
||||
protected:
|
||||
/*! Copy constructor. */
|
||||
@@ -649,7 +649,7 @@ protected:
|
||||
: ViewVertex(iBrother)
|
||||
{
|
||||
_SVertex = iBrother._SVertex;
|
||||
_SVertex->SetViewVertex(this);
|
||||
_SVertex->setViewVertex(this);
|
||||
_ViewEdges = iBrother._ViewEdges;
|
||||
}
|
||||
/*! Cloning method. */
|
||||
@@ -669,8 +669,8 @@ public:
|
||||
|
||||
/* modifiers */
|
||||
/*! Sets the SVertex on top of which this NonTVertex is built. */
|
||||
inline void SetSVertex(SVertex *iSVertex) {_SVertex = iSVertex;_SVertex->SetViewVertex(this);}
|
||||
inline void SetViewEdges(const vector<directedViewEdge>& iViewEdges) {_ViewEdges = iViewEdges;}
|
||||
inline void setSVertex(SVertex *iSVertex) {_SVertex = iSVertex;_SVertex->setViewVertex(this);}
|
||||
inline void setViewEdges(const vector<directedViewEdge>& iViewEdges) {_ViewEdges = iViewEdges;}
|
||||
void AddIncomingViewEdge(ViewEdge * iVEdge) ;
|
||||
void AddOutgoingViewEdge(ViewEdge * iVEdge) ;
|
||||
inline void AddViewEdge(ViewEdge * iVEdge, bool incoming=true) {
|
||||
@@ -938,28 +938,28 @@ public:
|
||||
|
||||
/* modifiers */
|
||||
/*! Sets the first ViewVertex of the ViewEdge. */
|
||||
inline void SetA(ViewVertex* iA) { __A = iA; }
|
||||
inline void setA(ViewVertex* iA) { __A = iA; }
|
||||
/*! Sets the last ViewVertex of the ViewEdge. */
|
||||
inline void SetB(ViewVertex* iB) { __B = iB; }
|
||||
inline void setB(ViewVertex* iB) { __B = iB; }
|
||||
/*! Sets the nature of the ViewEdge. */
|
||||
inline void SetNature(Nature::EdgeNature iNature) { _Nature = iNature; }
|
||||
inline void setNature(Nature::EdgeNature iNature) { _Nature = iNature; }
|
||||
/*! Sets the first FEdge of the ViewEdge. */
|
||||
inline void SetFEdgeA(FEdge* iFEdge) { _FEdgeA = iFEdge; }
|
||||
inline void setFEdgeA(FEdge* iFEdge) { _FEdgeA = iFEdge; }
|
||||
/*! Sets the last FEdge of the ViewEdge. */
|
||||
inline void SetFEdgeB(FEdge* iFEdge) { _FEdgeB = iFEdge; }
|
||||
inline void setFEdgeB(FEdge* iFEdge) { _FEdgeB = iFEdge; }
|
||||
/*! Sets the ViewShape to which this ViewEdge belongs to.*/
|
||||
inline void SetShape(ViewShape *iVShape)
|
||||
inline void setShape(ViewShape *iVShape)
|
||||
{
|
||||
_Shape = iVShape;
|
||||
}
|
||||
/*! Sets the ViewEdge id. */
|
||||
inline void SetId(const Id& id) {_Id = id;}
|
||||
inline void setId(const Id& id) {_Id = id;}
|
||||
/*! Sets Viewedge to this for all embedded fedges */
|
||||
void UpdateFEdges();
|
||||
/*! Sets the occluded ViewShape */
|
||||
inline void SetaShape(ViewShape * iShape) {_aShape = iShape;}
|
||||
inline void setaShape(ViewShape * iShape) {_aShape = iShape;}
|
||||
/*! Sets the quantitative invisibility value. */
|
||||
inline void SetQI(int qi) {_qi = qi;}
|
||||
inline void setQI(int qi) {_qi = qi;}
|
||||
/*! Sets the time stamp value. */
|
||||
inline void setChainingTimeStamp(unsigned ts) {_ChainingTimeStamp = ts;}
|
||||
inline void AddOccluder(ViewShape *iShape) {_Occluders.push_back(iShape);}
|
||||
@@ -1099,7 +1099,7 @@ public:
|
||||
/*! Default constructor.*/
|
||||
inline ViewShape() { userdata = 0; _SShape = 0;}
|
||||
/*! Builds a ViewShape from a SShape. */
|
||||
inline ViewShape(SShape *iSShape) {userdata = 0; _SShape = iSShape;}//_SShape->SetViewShape(this);}
|
||||
inline ViewShape(SShape *iSShape) {userdata = 0; _SShape = iSShape;}//_SShape->setViewShape(this);}
|
||||
/*! Copy constructor. */
|
||||
inline ViewShape(ViewShape& iBrother)
|
||||
{
|
||||
@@ -1146,10 +1146,10 @@ public:
|
||||
ViewEdge *veBackA = (ViewEdge*)(v)->backEdgeA().first->userdata;
|
||||
ViewEdge *veBackB = (ViewEdge*)(v)->backEdgeB().first->userdata;
|
||||
|
||||
v->SetFrontEdgeA(veFrontA, v->frontEdgeA().second);
|
||||
v->SetFrontEdgeB(veFrontB, v->frontEdgeB().second);
|
||||
v->SetBackEdgeA(veBackA, v->backEdgeA().second);
|
||||
v->SetBackEdgeB(veBackB, v->backEdgeB().second);
|
||||
v->setFrontEdgeA(veFrontA, v->frontEdgeA().second);
|
||||
v->setFrontEdgeB(veFrontB, v->frontEdgeB().second);
|
||||
v->setBackEdgeA(veBackA, v->backEdgeA().second);
|
||||
v->setBackEdgeB(veBackB, v->backEdgeB().second);
|
||||
}
|
||||
break;
|
||||
case Nature::NON_T_VERTEX:
|
||||
@@ -1164,7 +1164,7 @@ public:
|
||||
ViewEdge *current = (ViewEdge*)((ve)->first)->userdata;
|
||||
newEdges.push_back(ViewVertex::directedViewEdge(current, ve->second));
|
||||
}
|
||||
(v)->SetViewEdges(newEdges);
|
||||
(v)->setViewEdges(newEdges);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -1179,8 +1179,8 @@ public:
|
||||
ve!=veend;
|
||||
ve++)
|
||||
{
|
||||
(*ve)->SetA((ViewVertex*)((*ve)->A()->userdata));
|
||||
(*ve)->SetB((ViewVertex*)((*ve)->B()->userdata));
|
||||
(*ve)->setA((ViewVertex*)((*ve)->A()->userdata));
|
||||
(*ve)->setB((ViewVertex*)((*ve)->B()->userdata));
|
||||
//---------------------------------------
|
||||
// Update all embedded FEdges
|
||||
//---------------------------------------
|
||||
@@ -1253,11 +1253,11 @@ public:
|
||||
|
||||
/* modifiers */
|
||||
/*! Sets the SShape on top of which the ViewShape is built. */
|
||||
inline void SetSShape(SShape* iSShape) {_SShape = iSShape;}
|
||||
inline void setSShape(SShape* iSShape) {_SShape = iSShape;}
|
||||
/*! Sets the list of ViewVertex contained in this ViewShape. */
|
||||
inline void SetVertices(const vector<ViewVertex*>& iVertices) {_Vertices = iVertices;}
|
||||
inline void setVertices(const vector<ViewVertex*>& iVertices) {_Vertices = iVertices;}
|
||||
/*! Sets the list of ViewEdge contained in this ViewShape. */
|
||||
inline void SetEdges(const vector<ViewEdge*>& iEdges) {_Edges = iEdges;}
|
||||
inline void setEdges(const vector<ViewEdge*>& iEdges) {_Edges = iEdges;}
|
||||
/*! Adds a ViewVertex to the list. */
|
||||
inline void AddVertex(ViewVertex *iVertex)
|
||||
{
|
||||
@@ -1268,7 +1268,7 @@ public:
|
||||
inline void AddEdge(ViewEdge *iEdge)
|
||||
{
|
||||
_Edges.push_back(iEdge);
|
||||
iEdge->SetShape(this);
|
||||
iEdge->setShape(this);
|
||||
//_SShape->AddNewEdge(iEdge->fedge());
|
||||
}
|
||||
|
||||
@@ -1358,13 +1358,13 @@ void ViewShape::SplitEdge(FEdge *fe,
|
||||
// remove the chain that was starting by the fedge A of vEdge (which is different from fe !!!!)
|
||||
shape->RemoveEdgeFromChain(vEdge->fedgeA());
|
||||
// we set
|
||||
vEdge->SetA(*vv);
|
||||
vEdge->SetB(*vv);
|
||||
vEdge->SetFEdgeA(newEdge);
|
||||
vEdge->setA(*vv);
|
||||
vEdge->setB(*vv);
|
||||
vEdge->setFEdgeA(newEdge);
|
||||
//FEdge *previousEdge = newEdge->previousEdge();
|
||||
vEdge->SetFEdgeB(fe);
|
||||
vEdge->setFEdgeB(fe);
|
||||
newVEdge = vEdge;
|
||||
vEdge->fedgeA()->SetViewEdge(newVEdge);
|
||||
vEdge->fedgeA()->setViewEdge(newVEdge);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1372,15 +1372,15 @@ void ViewShape::SplitEdge(FEdge *fe,
|
||||
// while we create the view edge, it updates the "ViewEdge" pointer
|
||||
// of every underlying FEdges to this.
|
||||
newVEdge = new ViewEdge((*vv),vvb);//, newEdge, vEdge->fedgeB());
|
||||
newVEdge->SetNature((fe)->getNature());
|
||||
newVEdge->SetFEdgeA(newEdge);
|
||||
//newVEdge->SetFEdgeB(fe);
|
||||
newVEdge->setNature((fe)->getNature());
|
||||
newVEdge->setFEdgeA(newEdge);
|
||||
//newVEdge->setFEdgeB(fe);
|
||||
// If our original viewedge is made of one FEdge,
|
||||
// then
|
||||
if((vEdge->fedgeA() == vEdge->fedgeB()) || (fe == vEdge->fedgeB()))
|
||||
newVEdge->SetFEdgeB(newEdge);
|
||||
newVEdge->setFEdgeB(newEdge);
|
||||
else
|
||||
newVEdge->SetFEdgeB(vEdge->fedgeB()); //MODIF
|
||||
newVEdge->setFEdgeB(vEdge->fedgeB()); //MODIF
|
||||
|
||||
Id * newId = vEdge->splittingId();
|
||||
if(newId == 0){
|
||||
@@ -1388,11 +1388,11 @@ void ViewShape::SplitEdge(FEdge *fe,
|
||||
vEdge->setSplittingId(newId);
|
||||
}
|
||||
newId->setSecond(newId->getSecond()+1);
|
||||
newVEdge->SetId(*newId);
|
||||
newVEdge->setId(*newId);
|
||||
newVEdge->setSplittingId(newId);
|
||||
// Id id(vEdge->getId().getFirst(), vEdge->getId().getSecond()+1);
|
||||
// newVEdge->SetId(vEdge->getId());
|
||||
// vEdge->SetId(id);
|
||||
// newVEdge->setId(vEdge->getId());
|
||||
// vEdge->setId(id);
|
||||
|
||||
AddEdge(newVEdge); // here this shape is set as the edge's shape
|
||||
|
||||
@@ -1405,8 +1405,8 @@ void ViewShape::SplitEdge(FEdge *fe,
|
||||
vvb->Replace((vEdge), newVEdge);
|
||||
|
||||
// we split the view edge:
|
||||
vEdge->SetB((*vv));
|
||||
vEdge->SetFEdgeB(fe); //MODIF
|
||||
vEdge->setB((*vv));
|
||||
vEdge->setFEdgeB(fe); //MODIF
|
||||
|
||||
// Update fedges so that they point to the new viewedge:
|
||||
newVEdge->UpdateFEdges();
|
||||
@@ -1418,14 +1418,14 @@ void ViewShape::SplitEdge(FEdge *fe,
|
||||
if(sv == (*vv)->frontSVertex())
|
||||
{
|
||||
// -- View Vertex A' --
|
||||
(*vv)->SetFrontEdgeA(vEdge, true);
|
||||
(*vv)->SetFrontEdgeB(newVEdge, false);
|
||||
(*vv)->setFrontEdgeA(vEdge, true);
|
||||
(*vv)->setFrontEdgeB(newVEdge, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
// -- View Vertex A' --
|
||||
(*vv)->SetBackEdgeA(vEdge, true);
|
||||
(*vv)->SetBackEdgeB(newVEdge, false);
|
||||
(*vv)->setBackEdgeA(vEdge, true);
|
||||
(*vv)->setBackEdgeB(newVEdge, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,17 +55,17 @@ void ViewMapBuilder::computeInitialViewEdges(WingedEdge& we)
|
||||
it++) {
|
||||
// create the embedding
|
||||
psShape = new SShape;
|
||||
psShape->SetId((*it)->GetId());
|
||||
psShape->SetMaterials((*it)->materials()); // FIXME
|
||||
psShape->setId((*it)->GetId());
|
||||
psShape->setMaterials((*it)->materials()); // FIXME
|
||||
|
||||
// create the view shape
|
||||
ViewShape * vshape = new ViewShape(psShape);
|
||||
// add this view shape to the view map:
|
||||
_ViewMap->AddViewShape(vshape);
|
||||
|
||||
_pViewEdgeBuilder->SetCurrentViewId(_currentId); // we want to number the view edges in a unique way for the while scene.
|
||||
_pViewEdgeBuilder->SetCurrentFId(_currentFId); // we want to number the feature edges in a unique way for the while scene.
|
||||
_pViewEdgeBuilder->SetCurrentSVertexId(_currentFId); // we want to number the SVertex in a unique way for the while scene.
|
||||
_pViewEdgeBuilder->setCurrentViewId(_currentId); // we want to number the view edges in a unique way for the while scene.
|
||||
_pViewEdgeBuilder->setCurrentFId(_currentFId); // we want to number the feature edges in a unique way for the while scene.
|
||||
_pViewEdgeBuilder->setCurrentSVertexId(_currentFId); // we want to number the SVertex in a unique way for the while scene.
|
||||
_pViewEdgeBuilder->BuildViewEdges(dynamic_cast<WXShape*>(*it), vshape,
|
||||
_ViewMap->ViewEdges(),
|
||||
_ViewMap->ViewVertices(),
|
||||
@@ -239,12 +239,12 @@ void ViewMapBuilder::ComputeRayCastingVisibility(ViewMap *ioViewMap, Grid* iGrid
|
||||
FindOccludee(fe, iGrid, epsilon, &aFace, timestamp++);
|
||||
|
||||
if(aFace) {
|
||||
fe->SetaFace(*aFace);
|
||||
fe->setaFace(*aFace);
|
||||
aFaces.push_back(aFace);
|
||||
fe->SetOccludeeEmpty(false);
|
||||
fe->setOccludeeEmpty(false);
|
||||
}
|
||||
else
|
||||
fe->SetOccludeeEmpty(true);
|
||||
fe->setOccludeeEmpty(true);
|
||||
|
||||
++nSamples;
|
||||
fe = fe->nextEdge();
|
||||
@@ -253,7 +253,7 @@ void ViewMapBuilder::ComputeRayCastingVisibility(ViewMap *ioViewMap, Grid* iGrid
|
||||
|
||||
// ViewEdge
|
||||
// qi --
|
||||
(*ve)->SetQI(maxIndex);
|
||||
(*ve)->setQI(maxIndex);
|
||||
// occluders --
|
||||
for(set<ViewShape*>::iterator o=occluders.begin(), oend=occluders.end();
|
||||
o!=oend;
|
||||
@@ -264,7 +264,7 @@ void ViewMapBuilder::ComputeRayCastingVisibility(ViewMap *ioViewMap, Grid* iGrid
|
||||
{
|
||||
if(aFaces.size() <= (float)nSamples/2.f)
|
||||
{
|
||||
(*ve)->SetaShape(0);
|
||||
(*ve)->setaShape(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -272,7 +272,7 @@ void ViewMapBuilder::ComputeRayCastingVisibility(ViewMap *ioViewMap, Grid* iGrid
|
||||
WFace * wface = (WFace*)((*p)->userdata);
|
||||
ViewShape *vshape = ioViewMap->viewShape(wface->GetVertex(0)->shape()->GetId());
|
||||
++p;
|
||||
(*ve)->SetaShape(vshape);
|
||||
(*ve)->setaShape(vshape);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -360,7 +360,7 @@ void ViewMapBuilder::ComputeFastRayCastingVisibility(ViewMap *ioViewMap, Grid* i
|
||||
|
||||
if(aFace)
|
||||
{
|
||||
fe->SetaFace(*aFace);
|
||||
fe->setaFace(*aFace);
|
||||
aFaces.push_back(aFace);
|
||||
}
|
||||
++nSamples;
|
||||
@@ -371,13 +371,13 @@ void ViewMapBuilder::ComputeFastRayCastingVisibility(ViewMap *ioViewMap, Grid* i
|
||||
fe = fe->nextEdge();
|
||||
} while ((maxCard < qiMajority) && (0!=fe) && (fe!=festart));
|
||||
|
||||
(*ve)->SetQI(maxIndex);
|
||||
(*ve)->setQI(maxIndex);
|
||||
|
||||
if(!aFaces.empty())
|
||||
{
|
||||
if(aFaces.size() < nSamples / 2)
|
||||
{
|
||||
(*ve)->SetaShape(0);
|
||||
(*ve)->setaShape(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -398,11 +398,11 @@ void ViewMapBuilder::ComputeFastRayCastingVisibility(ViewMap *ioViewMap, Grid* i
|
||||
// }
|
||||
// }
|
||||
// if(sameShape)
|
||||
(*ve)->SetaShape(vshape);
|
||||
(*ve)->setaShape(vshape);
|
||||
}
|
||||
}
|
||||
|
||||
//(*ve)->SetaFace(aFace);
|
||||
//(*ve)->setaFace(aFace);
|
||||
|
||||
if(progressBarDisplay) {
|
||||
counter--;
|
||||
@@ -448,17 +448,17 @@ void ViewMapBuilder::ComputeVeryFastRayCastingVisibility(ViewMap *ioViewMap, Gri
|
||||
qi = ComputeRayCastingVisibility(fe, iGrid, epsilon, occluders, &aFace, timestamp++);
|
||||
if(aFace)
|
||||
{
|
||||
fe->SetaFace(*aFace);
|
||||
fe->setaFace(*aFace);
|
||||
WFace * wface = (WFace*)(aFace->userdata);
|
||||
ViewShape *vshape = ioViewMap->viewShape(wface->GetVertex(0)->shape()->GetId());
|
||||
(*ve)->SetaShape(vshape);
|
||||
(*ve)->setaShape(vshape);
|
||||
}
|
||||
else
|
||||
{
|
||||
(*ve)->SetaShape(0);
|
||||
(*ve)->setaShape(0);
|
||||
}
|
||||
|
||||
(*ve)->SetQI(qi);
|
||||
(*ve)->setQI(qi);
|
||||
|
||||
if(progressBarDisplay) {
|
||||
counter--;
|
||||
@@ -562,7 +562,7 @@ void ViewMapBuilder::FindOccludee(FEdge *fe, Grid* iGrid, real epsilon, Polygon3
|
||||
*oaPolygon = (*p);
|
||||
mint = t;
|
||||
noIntersection = false;
|
||||
fe->SetOccludeeIntersection(Vec3r(A+t*v));
|
||||
fe->setOccludeeIntersection(Vec3r(A+t*v));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ public:
|
||||
|
||||
|
||||
/*! Sets the current viewpoint */
|
||||
inline void SetViewpoint(const Vec3r& ivp) {_viewpoint = ivp; SilhouetteGeomEngine::SetViewpoint(ivp);}
|
||||
inline void setViewpoint(const Vec3r& ivp) {_viewpoint = ivp; SilhouetteGeomEngine::setViewpoint(ivp);}
|
||||
|
||||
/*! Sets the current transformation
|
||||
* iModelViewMatrix
|
||||
@@ -123,17 +123,17 @@ public:
|
||||
* iViewport
|
||||
* The viewport. 4 real array: origin.x, origin.y, width, length
|
||||
*/
|
||||
inline void SetTransform(const real iModelViewMatrix[4][4],
|
||||
inline void setTransform(const real iModelViewMatrix[4][4],
|
||||
const real iProjectionMatrix[4][4],
|
||||
const int iViewport[4],
|
||||
real iFocalLength,
|
||||
real iAspect,
|
||||
real iFovy) {
|
||||
SilhouetteGeomEngine::SetTransform(iModelViewMatrix, iProjectionMatrix, iViewport, iFocalLength);
|
||||
SilhouetteGeomEngine::setTransform(iModelViewMatrix, iProjectionMatrix, iViewport, iFocalLength);
|
||||
}
|
||||
|
||||
inline void SetFrustum(real iZnear, real iZfar) {
|
||||
SilhouetteGeomEngine::SetFrustum(iZnear, iZfar);
|
||||
inline void setFrustum(real iZnear, real iZfar) {
|
||||
SilhouetteGeomEngine::setFrustum(iZnear, iZfar);
|
||||
}
|
||||
|
||||
/*! Builds the scene view map
|
||||
@@ -164,13 +164,13 @@ public:
|
||||
*/
|
||||
void ComputeEdgesVisibility(ViewMap *ioViewMap, visibility_algo iAlgo= ray_casting, Grid* iGrid = 0, real epsilon=1e-6);
|
||||
|
||||
void SetGrid(Grid *iGrid) {_Grid = iGrid;}
|
||||
void setGrid(Grid *iGrid) {_Grid = iGrid;}
|
||||
|
||||
/*! accessors */
|
||||
|
||||
/*! Modifiers */
|
||||
inline void SetProgressBar(ProgressBar *iProgressBar) {_pProgressBar = iProgressBar;}
|
||||
inline void SetEnableQI(bool iBool) {_EnableQI = iBool;}
|
||||
inline void setProgressBar(ProgressBar *iProgressBar) {_pProgressBar = iProgressBar;}
|
||||
inline void setEnableQI(bool iBool) {_EnableQI = iBool;}
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
@@ -99,26 +99,26 @@ namespace ViewMapIO {
|
||||
// Diffuse
|
||||
for (i = 0; i < 4; i++)
|
||||
READ(tmp_array[i]);
|
||||
m.SetDiffuse(tmp_array[0], tmp_array[1], tmp_array[2], tmp_array[3]);
|
||||
m.setDiffuse(tmp_array[0], tmp_array[1], tmp_array[2], tmp_array[3]);
|
||||
|
||||
// Specular
|
||||
for (i = 0; i < 4; i++)
|
||||
READ(tmp_array[i]);
|
||||
m.SetSpecular(tmp_array[0], tmp_array[1], tmp_array[2], tmp_array[3]);
|
||||
m.setSpecular(tmp_array[0], tmp_array[1], tmp_array[2], tmp_array[3]);
|
||||
|
||||
// Ambient
|
||||
for (i = 0; i < 4; i++)
|
||||
READ(tmp_array[i]);
|
||||
m.SetAmbient(tmp_array[0], tmp_array[1], tmp_array[2], tmp_array[3]);
|
||||
m.setAmbient(tmp_array[0], tmp_array[1], tmp_array[2], tmp_array[3]);
|
||||
|
||||
// Emission
|
||||
for (i = 0; i < 4; i++)
|
||||
READ(tmp_array[i]);
|
||||
m.SetEmission(tmp_array[0], tmp_array[1], tmp_array[2], tmp_array[3]);
|
||||
m.setEmission(tmp_array[0], tmp_array[1], tmp_array[2], tmp_array[3]);
|
||||
|
||||
// Shininess
|
||||
READ(tmp_array[0]);
|
||||
m.SetShininess(tmp_array[0]);
|
||||
m.setShininess(tmp_array[0]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -135,12 +135,12 @@ namespace ViewMapIO {
|
||||
Id::id_type id1, id2;
|
||||
READ(id1);
|
||||
READ(id2);
|
||||
vs->sshape()->SetId(Id(id1, id2));
|
||||
vs->sshape()->setId(Id(id1, id2));
|
||||
|
||||
// -> Importance
|
||||
float importance;
|
||||
READ(importance);
|
||||
vs->sshape()->SetImportance(importance);
|
||||
vs->sshape()->setImportance(importance);
|
||||
|
||||
// -> BBox
|
||||
// Not necessary (only used during view map computatiom)
|
||||
@@ -155,7 +155,7 @@ namespace ViewMapIO {
|
||||
load(in, m);
|
||||
materials.push_back(m);
|
||||
}
|
||||
vs->sshape()->SetMaterials(materials);
|
||||
vs->sshape()->setMaterials(materials);
|
||||
|
||||
|
||||
|
||||
@@ -222,51 +222,51 @@ namespace ViewMapIO {
|
||||
Id::id_type id1, id2;
|
||||
READ(id1);
|
||||
READ(id2);
|
||||
fe->SetId(Id(id1, id2));
|
||||
fe->setId(Id(id1, id2));
|
||||
|
||||
// Nature
|
||||
Nature::EdgeNature nature;
|
||||
READ(nature);
|
||||
fe->SetNature(nature);
|
||||
fe->setNature(nature);
|
||||
|
||||
// hasVisibilityPoint
|
||||
// bool b;
|
||||
// READ(b);
|
||||
// fe->SetHasVisibilityPoint(b);
|
||||
// fe->setHasVisibilityPoint(b);
|
||||
|
||||
Vec3r v;
|
||||
unsigned int matindex;
|
||||
|
||||
// VisibilityPointA
|
||||
// load(in, v);
|
||||
// fe->SetVisibilityPointA(v);
|
||||
// fe->setVisibilityPointA(v);
|
||||
|
||||
// VisibilityPointB
|
||||
// load(in, v);
|
||||
// fe->SetVisibilityPointB(v);
|
||||
// fe->setVisibilityPointB(v);
|
||||
|
||||
if(fe->isSmooth()){
|
||||
// Normal
|
||||
load(in, v);
|
||||
fesmooth->SetNormal(v);
|
||||
fesmooth->setNormal(v);
|
||||
|
||||
// Material
|
||||
READ(matindex);
|
||||
fesmooth->SetMaterialIndex(matindex);
|
||||
fesmooth->setMaterialIndex(matindex);
|
||||
}else{
|
||||
// aNormal
|
||||
load(in, v);
|
||||
fesharp->SetNormalA(v);
|
||||
fesharp->setNormalA(v);
|
||||
|
||||
// bNormal
|
||||
load(in, v);
|
||||
fesharp->SetNormalB(v);
|
||||
fesharp->setNormalB(v);
|
||||
|
||||
// Materials
|
||||
READ(matindex);
|
||||
fesharp->SetaMaterialIndex(matindex);
|
||||
fesharp->setaMaterialIndex(matindex);
|
||||
READ(matindex);
|
||||
fesharp->SetbMaterialIndex(matindex);
|
||||
fesharp->setbMaterialIndex(matindex);
|
||||
}
|
||||
|
||||
unsigned tmp;
|
||||
@@ -274,27 +274,27 @@ namespace ViewMapIO {
|
||||
// VertexA
|
||||
SVertex* sva;
|
||||
READ_IF_NON_NULL(sva, g_vm->SVertices());
|
||||
fe->SetVertexA(sva);
|
||||
fe->setVertexA(sva);
|
||||
|
||||
// VertexB
|
||||
SVertex* svb;
|
||||
READ_IF_NON_NULL(svb, g_vm->SVertices());
|
||||
fe->SetVertexB(svb);
|
||||
fe->setVertexB(svb);
|
||||
|
||||
// NextEdge
|
||||
FEdge* nfe;
|
||||
READ_IF_NON_NULL(nfe, g_vm->FEdges());
|
||||
fe->SetNextEdge(nfe);
|
||||
fe->setNextEdge(nfe);
|
||||
|
||||
// PreviousEdge
|
||||
FEdge* pfe;
|
||||
READ_IF_NON_NULL(pfe, g_vm->FEdges());
|
||||
fe->SetPreviousEdge(pfe);
|
||||
fe->setPreviousEdge(pfe);
|
||||
|
||||
// ViewEdge
|
||||
ViewEdge* ve;
|
||||
READ_IF_NON_NULL(ve, g_vm->ViewEdges());
|
||||
fe->SetViewEdge(ve);
|
||||
fe->setViewEdge(ve);
|
||||
|
||||
// Face
|
||||
// Not necessary (only used during view map computatiom)
|
||||
@@ -303,15 +303,15 @@ namespace ViewMapIO {
|
||||
|
||||
// aFace
|
||||
load(in, p);
|
||||
fe->SetaFace(p);
|
||||
fe->setaFace(p);
|
||||
|
||||
// occludeeEmpty
|
||||
READ(b);
|
||||
fe->SetOccludeeEmpty(b);
|
||||
fe->setOccludeeEmpty(b);
|
||||
|
||||
// occludeeIntersection
|
||||
load(in, v);
|
||||
fe->SetOccludeeIntersection(v);
|
||||
fe->setOccludeeIntersection(v);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -326,29 +326,29 @@ namespace ViewMapIO {
|
||||
Id::id_type id1, id2;
|
||||
READ(id1);
|
||||
READ(id2);
|
||||
sv->SetId(Id(id1, id2));
|
||||
sv->setId(Id(id1, id2));
|
||||
|
||||
Vec3r v;
|
||||
|
||||
// Point3D
|
||||
load(in, v);
|
||||
sv->SetPoint3D(v);
|
||||
sv->setPoint3D(v);
|
||||
|
||||
// Point2D
|
||||
load(in, v);
|
||||
sv->SetPoint2D(v);
|
||||
sv->setPoint2D(v);
|
||||
|
||||
unsigned tmp;
|
||||
|
||||
// Shape
|
||||
ViewShape* vs;
|
||||
READ_IF_NON_NULL(vs, g_vm->ViewShapes());
|
||||
sv->SetShape(vs->sshape());
|
||||
sv->setShape(vs->sshape());
|
||||
|
||||
// pViewVertex
|
||||
ViewVertex* vv;
|
||||
READ_IF_NON_NULL(vv, g_vm->ViewVertices());
|
||||
sv->SetViewVertex(vv);
|
||||
sv->setViewVertex(vv);
|
||||
|
||||
unsigned i, size;
|
||||
|
||||
@@ -382,46 +382,46 @@ namespace ViewMapIO {
|
||||
Id::id_type id1, id2;
|
||||
READ(id1);
|
||||
READ(id2);
|
||||
ve->SetId(Id(id1, id2));
|
||||
ve->setId(Id(id1, id2));
|
||||
|
||||
// Nature
|
||||
Nature::EdgeNature nature;
|
||||
READ(nature);
|
||||
ve->SetNature(nature);
|
||||
ve->setNature(nature);
|
||||
|
||||
// QI
|
||||
READ(tmp);
|
||||
ve->SetQI(tmp);
|
||||
ve->setQI(tmp);
|
||||
|
||||
// Shape
|
||||
ViewShape* vs;
|
||||
READ_IF_NON_NULL(vs, g_vm->ViewShapes());
|
||||
ve->SetShape(vs);
|
||||
ve->setShape(vs);
|
||||
|
||||
// aShape
|
||||
ViewShape* avs;
|
||||
READ_IF_NON_NULL(avs, g_vm->ViewShapes());
|
||||
ve->SetaShape(avs);
|
||||
ve->setaShape(avs);
|
||||
|
||||
// FEdgeA
|
||||
FEdge* fea;
|
||||
READ_IF_NON_NULL(fea, g_vm->FEdges());
|
||||
ve->SetFEdgeA(fea);
|
||||
ve->setFEdgeA(fea);
|
||||
|
||||
// FEdgeB
|
||||
FEdge* feb;
|
||||
READ_IF_NON_NULL(feb, g_vm->FEdges());
|
||||
ve->SetFEdgeB(feb);
|
||||
ve->setFEdgeB(feb);
|
||||
|
||||
// A
|
||||
ViewVertex* vva;
|
||||
READ_IF_NON_NULL(vva, g_vm->ViewVertices());
|
||||
ve->SetA(vva);
|
||||
ve->setA(vva);
|
||||
|
||||
// B
|
||||
ViewVertex* vvb;
|
||||
READ_IF_NON_NULL(vvb, g_vm->ViewVertices());
|
||||
ve->SetB(vvb);
|
||||
ve->setB(vvb);
|
||||
|
||||
// Occluders (List)
|
||||
if (!(Options::getFlags() & Options::NO_OCCLUDERS)) {
|
||||
@@ -458,41 +458,41 @@ namespace ViewMapIO {
|
||||
Id::id_type id1, id2;
|
||||
READ(id1);
|
||||
READ(id2);
|
||||
tv->SetId(Id(id1, id2));
|
||||
tv->setId(Id(id1, id2));
|
||||
|
||||
// FrontSVertex
|
||||
SVertex* fsv;
|
||||
READ_IF_NON_NULL(fsv, g_vm->SVertices());
|
||||
tv->SetFrontVertex(fsv);
|
||||
tv->setFrontVertex(fsv);
|
||||
|
||||
// BackSVertex
|
||||
SVertex* bsv;
|
||||
READ_IF_NON_NULL(bsv, g_vm->SVertices());
|
||||
tv->SetBackSVertex(bsv);
|
||||
tv->setBackSVertex(bsv);
|
||||
|
||||
// FrontEdgeA
|
||||
ViewEdge* fea;
|
||||
READ_IF_NON_NULL(fea, g_vm->ViewEdges());
|
||||
READ(b);
|
||||
tv->SetFrontEdgeA(fea, b);
|
||||
tv->setFrontEdgeA(fea, b);
|
||||
|
||||
// FrontEdgeB
|
||||
ViewEdge* feb;
|
||||
READ_IF_NON_NULL(feb, g_vm->ViewEdges());
|
||||
READ(b);
|
||||
tv->SetFrontEdgeB(feb, b);
|
||||
tv->setFrontEdgeB(feb, b);
|
||||
|
||||
// BackEdgeA
|
||||
ViewEdge* bea;
|
||||
READ_IF_NON_NULL(bea, g_vm->ViewEdges());
|
||||
READ(b);
|
||||
tv->SetBackEdgeA(bea, b);
|
||||
tv->setBackEdgeA(bea, b);
|
||||
|
||||
// BackEdgeB
|
||||
ViewEdge* beb;
|
||||
READ_IF_NON_NULL(beb, g_vm->ViewEdges());
|
||||
READ(b);
|
||||
tv->SetBackEdgeB(beb, b);
|
||||
tv->setBackEdgeB(beb, b);
|
||||
}
|
||||
else if (vv->getNature() & Nature::NON_T_VERTEX) {
|
||||
NonTVertex* ntv = dynamic_cast<NonTVertex*>(vv);
|
||||
@@ -500,7 +500,7 @@ namespace ViewMapIO {
|
||||
// SVertex
|
||||
SVertex* sv;
|
||||
READ_IF_NON_NULL(sv, g_vm->SVertices());
|
||||
ntv->SetSVertex(sv);
|
||||
ntv->setSVertex(sv);
|
||||
|
||||
// ViewEdges (List)
|
||||
unsigned size;
|
||||
@@ -1015,8 +1015,8 @@ namespace ViewMapIO {
|
||||
for (unsigned i0 = 0; i0 < vs_s; i0++) {
|
||||
SShape* ss = new SShape();
|
||||
ViewShape* vs = new ViewShape();
|
||||
vs->SetSShape(ss);
|
||||
ss->SetViewShape(vs);
|
||||
vs->setSShape(ss);
|
||||
ss->setViewShape(vs);
|
||||
vm->AddViewShape(vs);
|
||||
}
|
||||
// for (unsigned i1 = 0; i1 < fe_s; i1++) {
|
||||
|
||||
@@ -49,7 +49,7 @@ class LIB_VIEW_MAP_EXPORT ViewMapTesselator
|
||||
{
|
||||
public:
|
||||
|
||||
inline ViewMapTesselator() {_nature = Nature::SILHOUETTE | Nature::BORDER | Nature::CREASE;_Material.SetDiffuse(0,0,0,1);_overloadMaterial=false;}
|
||||
inline ViewMapTesselator() {_nature = Nature::SILHOUETTE | Nature::BORDER | Nature::CREASE;_Material.setDiffuse(0,0,0,1);_overloadMaterial=false;}
|
||||
virtual ~ViewMapTesselator() {}
|
||||
|
||||
/*! Builds a set of lines rep contained under a
|
||||
@@ -70,8 +70,8 @@ public:
|
||||
NodeGroup* Tesselate(WShape* iWShape);
|
||||
|
||||
|
||||
inline void SetNature(Nature::EdgeNature iNature) {_nature = iNature;}
|
||||
inline void SetMaterial(const Material& iMaterial) {_Material=iMaterial;_overloadMaterial=true;}
|
||||
inline void setNature(Nature::EdgeNature iNature) {_nature = iNature;}
|
||||
inline void setMaterial(const Material& iMaterial) {_Material=iMaterial;_overloadMaterial=true;}
|
||||
inline Nature::EdgeNature nature() {return _nature;}
|
||||
inline const Material& material() const {return _Material;}
|
||||
|
||||
@@ -123,8 +123,8 @@ NodeGroup * ViewMapTesselator::Tesselate(ViewEdgesIterator begin, ViewEdgesItera
|
||||
NodeGroup *group = new NodeGroup;
|
||||
NodeShape *tshape = new NodeShape;
|
||||
group->AddChild(tshape);
|
||||
//tshape->material().SetDiffuse(0.f, 0.f, 0.f, 1.f);
|
||||
tshape->SetMaterial(_Material);
|
||||
//tshape->material().setDiffuse(0.f, 0.f, 0.f, 1.f);
|
||||
tshape->setMaterial(_Material);
|
||||
|
||||
LineRep* line;
|
||||
|
||||
@@ -153,12 +153,12 @@ NodeGroup * ViewMapTesselator::Tesselate(ViewEdgesIterator begin, ViewEdgesItera
|
||||
|
||||
line = new OrientedLineRep();
|
||||
if(_overloadMaterial)
|
||||
line->SetMaterial(_Material);
|
||||
line->setMaterial(_Material);
|
||||
|
||||
// there might be chains containing a single element
|
||||
if(0 == (firstEdge)->nextEdge())
|
||||
{
|
||||
line->SetStyle(LineRep::LINES);
|
||||
line->setStyle(LineRep::LINES);
|
||||
// line->AddVertex((*c)->vertexA()->point3D());
|
||||
// line->AddVertex((*c)->vertexB()->point3D());
|
||||
AddVertexToLine(line, firstEdge->vertexA());
|
||||
@@ -166,7 +166,7 @@ NodeGroup * ViewMapTesselator::Tesselate(ViewEdgesIterator begin, ViewEdgesItera
|
||||
}
|
||||
else
|
||||
{
|
||||
line->SetStyle(LineRep::LINE_STRIP);
|
||||
line->setStyle(LineRep::LINE_STRIP);
|
||||
|
||||
//firstEdge = (*c);
|
||||
nextFEdge = firstEdge;
|
||||
@@ -184,7 +184,7 @@ NodeGroup * ViewMapTesselator::Tesselate(ViewEdgesIterator begin, ViewEdgesItera
|
||||
|
||||
}
|
||||
|
||||
line->SetId((*c)->getId().getFirst());
|
||||
line->setId((*c)->getId().getFirst());
|
||||
line->ComputeBBox();
|
||||
tshape->AddRep(line);
|
||||
id++;
|
||||
|
||||
@@ -292,10 +292,10 @@ WOEdge * WFace::MakeEdge(WVertex *v1, WVertex *v2)
|
||||
// Adds the edge to the face
|
||||
//AddEdge((*it1)->GetaOEdge());
|
||||
AddEdge(woea);
|
||||
(*it1)->SetNumberOfOEdges((*it1)->GetNumberOfOEdges()+1);
|
||||
(*it1)->setNumberOfOEdges((*it1)->GetNumberOfOEdges()+1);
|
||||
//sets these vertices as border:
|
||||
v1->SetBorder(true);
|
||||
v2->SetBorder(true);
|
||||
v1->setBorder(true);
|
||||
v2->setBorder(true);
|
||||
//return (*it1)->GetaOEdge();
|
||||
return woea;
|
||||
}
|
||||
@@ -311,10 +311,10 @@ WOEdge * WFace::MakeEdge(WVertex *v1, WVertex *v2)
|
||||
// Adds the edge to the face
|
||||
//AddEdge((*it1)->GetaOEdge());
|
||||
AddEdge(woeb);
|
||||
(*it1)->SetNumberOfOEdges((*it1)->GetNumberOfOEdges()+1);
|
||||
(*it1)->setNumberOfOEdges((*it1)->GetNumberOfOEdges()+1);
|
||||
//sets these vertices as border:
|
||||
v1->SetBorder(true);
|
||||
v2->SetBorder(true);
|
||||
v1->setBorder(true);
|
||||
v2->setBorder(true);
|
||||
//return (*it1)->GetaOEdge();
|
||||
return woeb;
|
||||
}
|
||||
@@ -352,10 +352,10 @@ WOEdge * WFace::MakeEdge(WVertex *v1, WVertex *v2)
|
||||
edge = pInvertEdge->GetOwner();
|
||||
|
||||
// Sets the a Face (retrieved from pInvertEdge
|
||||
pOEdge->SetaFace(pInvertEdge->GetbFace());
|
||||
pOEdge->setaFace(pInvertEdge->GetbFace());
|
||||
|
||||
// Updates the invert edge:
|
||||
pInvertEdge->SetaFace(this);
|
||||
pInvertEdge->setaFace(this);
|
||||
}
|
||||
else // The invert edge does not exist yet
|
||||
{
|
||||
@@ -369,20 +369,20 @@ WOEdge * WFace::MakeEdge(WVertex *v1, WVertex *v2)
|
||||
|
||||
}
|
||||
|
||||
pOEdge->SetOwner(edge);
|
||||
pOEdge->setOwner(edge);
|
||||
// Add the vertices:
|
||||
pOEdge->SetaVertex(v1);
|
||||
pOEdge->SetbVertex(v2);
|
||||
pOEdge->setaVertex(v1);
|
||||
pOEdge->setbVertex(v2);
|
||||
|
||||
// Debug:
|
||||
if(v1->GetId() == v2->GetId())
|
||||
cerr << "Warning: edge " << this << " null with vertex " << v1->GetId() << endl;
|
||||
|
||||
edge->AddOEdge(pOEdge);
|
||||
//edge->SetNumberOfOEdges(edge->GetNumberOfOEdges()+1);
|
||||
//edge->setNumberOfOEdges(edge->GetNumberOfOEdges()+1);
|
||||
|
||||
// Add this face (the b face)
|
||||
pOEdge->SetbFace(this);
|
||||
pOEdge->setbFace(this);
|
||||
|
||||
// Adds the edge to the face
|
||||
AddEdge(pOEdge);
|
||||
@@ -487,7 +487,7 @@ WShape::WShape(WShape& iBrother)
|
||||
//WVertex *newVertex = new WVertex(*(*v));
|
||||
WVertex *newVertex = (*v)->duplicate();
|
||||
|
||||
newVertex->SetShape(this);
|
||||
newVertex->setShape(this);
|
||||
AddVertex(newVertex);
|
||||
}
|
||||
|
||||
@@ -528,7 +528,7 @@ WShape::WShape(WShape& iBrother)
|
||||
edgedata * currentvedata = (edgedata*)current->userdata;
|
||||
newvedgelist.push_back(currentvedata->_copy);
|
||||
}
|
||||
(*v)->SetEdges(newvedgelist);
|
||||
(*v)->setEdges(newvedgelist);
|
||||
}
|
||||
|
||||
eend = _EdgeList.end();
|
||||
@@ -538,23 +538,23 @@ WShape::WShape(WShape& iBrother)
|
||||
{
|
||||
// update aOedge:
|
||||
WOEdge *aoEdge = (*e)->GetaOEdge();
|
||||
aoEdge->SetaVertex(((vertexdata*)(aoEdge->GetaVertex()->userdata))->_copy);
|
||||
aoEdge->SetbVertex(((vertexdata*)(aoEdge->GetbVertex()->userdata))->_copy);
|
||||
aoEdge->setaVertex(((vertexdata*)(aoEdge->GetaVertex()->userdata))->_copy);
|
||||
aoEdge->setbVertex(((vertexdata*)(aoEdge->GetbVertex()->userdata))->_copy);
|
||||
if(NULL != aoEdge->GetaFace())
|
||||
aoEdge->SetaFace(((facedata*)(aoEdge->GetaFace()->userdata))->_copy);
|
||||
aoEdge->SetbFace(((facedata*)(aoEdge->GetbFace()->userdata))->_copy);
|
||||
aoEdge->SetOwner(((edgedata*)(aoEdge->GetOwner()->userdata))->_copy);
|
||||
aoEdge->setaFace(((facedata*)(aoEdge->GetaFace()->userdata))->_copy);
|
||||
aoEdge->setbFace(((facedata*)(aoEdge->GetbFace()->userdata))->_copy);
|
||||
aoEdge->setOwner(((edgedata*)(aoEdge->GetOwner()->userdata))->_copy);
|
||||
// update bOedge:
|
||||
|
||||
WOEdge *boEdge = (*e)->GetbOEdge();
|
||||
if(boEdge != 0)
|
||||
{
|
||||
boEdge->SetaVertex(((vertexdata*)(boEdge->GetaVertex()->userdata))->_copy);
|
||||
boEdge->SetbVertex(((vertexdata*)(boEdge->GetbVertex()->userdata))->_copy);
|
||||
boEdge->setaVertex(((vertexdata*)(boEdge->GetaVertex()->userdata))->_copy);
|
||||
boEdge->setbVertex(((vertexdata*)(boEdge->GetbVertex()->userdata))->_copy);
|
||||
if(NULL != boEdge->GetaFace())
|
||||
boEdge->SetaFace(((facedata*)(boEdge->GetaFace()->userdata))->_copy);
|
||||
boEdge->SetbFace(((facedata*)(boEdge->GetbFace()->userdata))->_copy);
|
||||
boEdge->SetOwner(((edgedata*)(boEdge->GetOwner()->userdata))->_copy);
|
||||
boEdge->setaFace(((facedata*)(boEdge->GetaFace()->userdata))->_copy);
|
||||
boEdge->setbFace(((facedata*)(boEdge->GetbFace()->userdata))->_copy);
|
||||
boEdge->setOwner(((edgedata*)(boEdge->GetOwner()->userdata))->_copy);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -576,7 +576,7 @@ WShape::WShape(WShape& iBrother)
|
||||
//oedgeList[i] = currentoedata->_copy;
|
||||
//oedgeList[i] = ((oedgedata*)(oedgeList[i]->userdata))->_copy;
|
||||
}
|
||||
(*f)->SetEdgeList(newoedgelist);
|
||||
(*f)->setEdgeList(newoedgelist);
|
||||
}
|
||||
|
||||
// Free all memory (arghh!)
|
||||
@@ -638,9 +638,9 @@ WFace * WShape::MakeFace(vector<WVertex*>& iVertexList, vector<Vec3r>& iNormalsL
|
||||
return 0;
|
||||
|
||||
// set the list of per-vertex normals
|
||||
face->SetNormalList(iNormalsList);
|
||||
face->setNormalList(iNormalsList);
|
||||
// set the list of per-vertex tex coords
|
||||
face->SetTexCoordsList(iTexCoordsList);
|
||||
face->setTexCoordsList(iTexCoordsList);
|
||||
|
||||
return face;
|
||||
}
|
||||
@@ -650,7 +650,7 @@ WFace* WShape::MakeFace(vector<WVertex*>& iVertexList, unsigned iMaterial, WFace
|
||||
|
||||
int id = _FaceList.size();
|
||||
|
||||
face->SetMaterialIndex(iMaterial);
|
||||
face->setMaterialIndex(iMaterial);
|
||||
|
||||
// Check whether we have a degenerated face:
|
||||
|
||||
@@ -701,7 +701,7 @@ WFace* WShape::MakeFace(vector<WVertex*>& iVertexList, unsigned iMaterial, WFace
|
||||
{
|
||||
// means that we just created a new edge and that we must add it to the
|
||||
// shape's edges list
|
||||
edge->SetId(_EdgeList.size());
|
||||
edge->setId(_EdgeList.size());
|
||||
AddEdge(edge);
|
||||
// compute the mean edge value:
|
||||
_meanEdgeSize += edge->GetaOEdge()->getVec3r().norm();
|
||||
@@ -722,10 +722,10 @@ WFace* WShape::MakeFace(vector<WVertex*>& iVertexList, unsigned iMaterial, WFace
|
||||
|
||||
Vec3r normal(vector1 ^ vector2);
|
||||
normal.normalize();
|
||||
face->SetNormal(normal);
|
||||
face->setNormal(normal);
|
||||
|
||||
// Add the face to the shape's faces list:
|
||||
face->SetId(id);
|
||||
face->setId(id);
|
||||
AddFace(face);
|
||||
|
||||
return face;
|
||||
|
||||
@@ -80,12 +80,12 @@ public:
|
||||
bool isBoundary();
|
||||
|
||||
/*! modifiers */
|
||||
inline void SetVertex(const Vec3r& v) {_Vertex = v;}
|
||||
inline void SetEdges(const vector<WEdge *>& iEdgeList) {_EdgeList = iEdgeList;}
|
||||
inline void SetId(int id) {_Id = id;}
|
||||
inline void SetShape(WShape *iShape) {_Shape = iShape;}
|
||||
inline void SetSmooth(bool b) {_Smooth = b;}
|
||||
inline void SetBorder(bool b) {if(b) _Border= 1; else _Border = 0;}
|
||||
inline void setVertex(const Vec3r& v) {_Vertex = v;}
|
||||
inline void setEdges(const vector<WEdge *>& iEdgeList) {_EdgeList = iEdgeList;}
|
||||
inline void setId(int id) {_Id = id;}
|
||||
inline void setShape(WShape *iShape) {_Shape = iShape;}
|
||||
inline void setSmooth(bool b) {_Smooth = b;}
|
||||
inline void setBorder(bool b) {if(b) _Border= 1; else _Border = 0;}
|
||||
|
||||
/*! Adds an edge to the edges list */
|
||||
void AddEdge(WEdge *iEdge) ;
|
||||
@@ -333,11 +333,11 @@ public:
|
||||
// inline void SetbCWEdge(WOEdge *pe) {_pbCWEdge = pe;}
|
||||
// inline void SetaCCWEdge(WOEdge *pe) {_paCCWEdge = pe;}
|
||||
// inline void SetbCCCWEdge(WOEdge *pe) {_pbCCWEdge = pe;}
|
||||
inline void SetaVertex(WVertex *pv) {_paVertex = pv;}
|
||||
inline void SetbVertex(WVertex *pv) {_pbVertex = pv;}
|
||||
inline void SetaFace(WFace *pf) {_paFace = pf;}
|
||||
inline void SetbFace(WFace *pf) {_pbFace = pf;}
|
||||
inline void SetOwner(WEdge *pe) {_pOwner = pe;}
|
||||
inline void setaVertex(WVertex *pv) {_paVertex = pv;}
|
||||
inline void setbVertex(WVertex *pv) {_pbVertex = pv;}
|
||||
inline void setaFace(WFace *pf) {_paFace = pf;}
|
||||
inline void setbFace(WFace *pf) {_pbFace = pf;}
|
||||
inline void setOwner(WEdge *pe) {_pOwner = pe;}
|
||||
|
||||
/*! Retrieves the list of edges in CW order */
|
||||
inline void RetrieveCWOrderedEdges(vector<WEdge*>& oEdges);
|
||||
@@ -453,8 +453,8 @@ public:
|
||||
}
|
||||
|
||||
/*! modifiers */
|
||||
inline void SetaOEdge(WOEdge *iEdge) {_paOEdge = iEdge;}
|
||||
inline void SetbOEdge(WOEdge *iEdge) {_pbOEdge = iEdge;}
|
||||
inline void setaOEdge(WOEdge *iEdge) {_paOEdge = iEdge;}
|
||||
inline void setbOEdge(WOEdge *iEdge) {_pbOEdge = iEdge;}
|
||||
inline void AddOEdge(WOEdge *iEdge)
|
||||
{
|
||||
if(NULL == _paOEdge)
|
||||
@@ -470,8 +470,8 @@ public:
|
||||
return;
|
||||
}
|
||||
}
|
||||
inline void SetNumberOfOEdges(int n) {_nOEdges = n;}
|
||||
inline void SetId(int id) {_Id = id;}
|
||||
inline void setNumberOfOEdges(int n) {_nOEdges = n;}
|
||||
inline void setId(int id) {_Id = id;}
|
||||
virtual void ResetUserData() {userdata = 0;}
|
||||
};
|
||||
|
||||
@@ -648,12 +648,12 @@ public:
|
||||
return false;
|
||||
}
|
||||
/*! modifiers */
|
||||
inline void SetEdgeList(const vector<WOEdge*>& iEdgeList) {_OEdgeList = iEdgeList;}
|
||||
inline void SetNormal(const Vec3r& iNormal) {_Normal = iNormal;}
|
||||
inline void SetNormalList(const vector<Vec3r>& iNormalsList) {_VerticesNormals = iNormalsList;}
|
||||
inline void SetTexCoordsList(const vector<Vec2r>& iTexCoordsList) {_VerticesTexCoords = iTexCoordsList;}
|
||||
inline void SetId(int id) {_Id = id;}
|
||||
inline void SetMaterialIndex(unsigned iMaterialIndex) {_MaterialIndex = iMaterialIndex;}
|
||||
inline void setEdgeList(const vector<WOEdge*>& iEdgeList) {_OEdgeList = iEdgeList;}
|
||||
inline void setNormal(const Vec3r& iNormal) {_Normal = iNormal;}
|
||||
inline void setNormalList(const vector<Vec3r>& iNormalsList) {_VerticesNormals = iNormalsList;}
|
||||
inline void setTexCoordsList(const vector<Vec2r>& iTexCoordsList) {_VerticesTexCoords = iTexCoordsList;}
|
||||
inline void setId(int id) {_Id = id;}
|
||||
inline void setMaterialIndex(unsigned iMaterialIndex) {_MaterialIndex = iMaterialIndex;}
|
||||
|
||||
/*! designed to build a specialized WEdge
|
||||
* for use in MakeEdge
|
||||
@@ -753,14 +753,14 @@ public:
|
||||
inline const vector<Material>& materials() const {return _Materials;}
|
||||
inline const real getMeanEdgeSize() const {return _meanEdgeSize;}
|
||||
/*! modifiers */
|
||||
static inline void SetCurrentId(const unsigned id) { _SceneCurrentId = id; }
|
||||
inline void SetEdgeList(const vector<WEdge*>& iEdgeList) {_EdgeList = iEdgeList;}
|
||||
inline void SetVertexList(const vector<WVertex*>& iVertexList) {_VertexList = iVertexList;}
|
||||
inline void SetFaceList(const vector<WFace*>& iFaceList) {_FaceList = iFaceList;}
|
||||
inline void SetId(int id) {_Id = id;}
|
||||
inline void SetBBox(const Vec3r& min, const Vec3r& max) {_min = min; _max=max;}
|
||||
inline void SetMaterial(const Material& material, unsigned i) {_Materials[i]=material;}
|
||||
inline void SetMaterials(const vector<Material>& iMaterials) {_Materials = iMaterials;}
|
||||
static inline void setCurrentId(const unsigned id) { _SceneCurrentId = id; }
|
||||
inline void setEdgeList(const vector<WEdge*>& iEdgeList) {_EdgeList = iEdgeList;}
|
||||
inline void setVertexList(const vector<WVertex*>& iVertexList) {_VertexList = iVertexList;}
|
||||
inline void setFaceList(const vector<WFace*>& iFaceList) {_FaceList = iFaceList;}
|
||||
inline void setId(int id) {_Id = id;}
|
||||
inline void setBBox(const Vec3r& min, const Vec3r& max) {_min = min; _max=max;}
|
||||
inline void setMaterial(const Material& material, unsigned i) {_Materials[i]=material;}
|
||||
inline void setMaterials(const vector<Material>& iMaterials) {_Materials = iMaterials;}
|
||||
|
||||
/*! designed to build a specialized WFace
|
||||
* for use in MakeFace
|
||||
@@ -806,7 +806,7 @@ public:
|
||||
|
||||
inline void AddEdge(WEdge *iEdge) {_EdgeList.push_back(iEdge);}
|
||||
inline void AddFace(WFace* iFace) {_FaceList.push_back(iFace);}
|
||||
inline void AddVertex(WVertex *iVertex) {iVertex->SetShape(this); _VertexList.push_back(iVertex);}
|
||||
inline void AddVertex(WVertex *iVertex) {iVertex->setShape(this); _VertexList.push_back(iVertex);}
|
||||
|
||||
inline void ResetUserData()
|
||||
{
|
||||
|
||||
@@ -162,16 +162,16 @@ WXSmoothEdge* WXFaceLayer::BuildSmoothEdge(){
|
||||
}
|
||||
if(ok){
|
||||
_pSmoothEdge = new WXSmoothEdge;
|
||||
_pSmoothEdge->SetWOeA(woea);
|
||||
_pSmoothEdge->SetWOeB(woeb);
|
||||
_pSmoothEdge->SetTa(ta);
|
||||
_pSmoothEdge->SetTb(tb);
|
||||
_pSmoothEdge->setWOeA(woea);
|
||||
_pSmoothEdge->setWOeB(woeb);
|
||||
_pSmoothEdge->setTa(ta);
|
||||
_pSmoothEdge->setTb(tb);
|
||||
if(_Nature & Nature::SILHOUETTE){
|
||||
if(_nNullDotP != 2){
|
||||
if(_DotP[_ClosestPointIndex] + 0.01 > 0)
|
||||
_pSmoothEdge->SetFront(true);
|
||||
_pSmoothEdge->setFront(true);
|
||||
else
|
||||
_pSmoothEdge->SetFront(false);
|
||||
_pSmoothEdge->setFront(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -221,10 +221,10 @@ WXSmoothEdge* WXFaceLayer::BuildSmoothEdge(){
|
||||
// }
|
||||
//
|
||||
// _pSmoothEdge = new ExactSilhouetteEdge(ExactSilhouetteEdge::VERTEX_VERTEX);
|
||||
// _pSmoothEdge->SetWOeA(woea);
|
||||
// _pSmoothEdge->SetWOeA(woeb);
|
||||
// _pSmoothEdge->SetTa(ta);
|
||||
// _pSmoothEdge->SetTb(tb);
|
||||
// _pSmoothEdge->setWOeA(woea);
|
||||
// _pSmoothEdge->setWOeA(woeb);
|
||||
// _pSmoothEdge->setTa(ta);
|
||||
// _pSmoothEdge->setTb(tb);
|
||||
//
|
||||
// return _pSmoothEdge;
|
||||
// }
|
||||
@@ -246,7 +246,7 @@ void WXFace::ComputeCenter()
|
||||
center += (*wv)->GetVertex();
|
||||
}
|
||||
center /= (real)iVertexList.size();
|
||||
SetCenter(center);
|
||||
setCenter(center);
|
||||
}
|
||||
|
||||
/**********************************/
|
||||
@@ -272,7 +272,7 @@ WFace* WXShape::MakeFace(vector<WVertex*>& iVertexList, unsigned iMaterialIndex)
|
||||
center += (*wv)->GetVertex();
|
||||
}
|
||||
center /= (real)iVertexList.size();
|
||||
((WXFace*)face)->SetCenter(center);
|
||||
((WXFace*)face)->setCenter(center);
|
||||
|
||||
return face;
|
||||
}
|
||||
@@ -289,7 +289,7 @@ WFace * WXShape::MakeFace(vector<WVertex*>& iVertexList, vector<Vec3r>& iNormals
|
||||
// center += (*wv)->GetVertex();
|
||||
// }
|
||||
// center /= (real)iVertexList.size();
|
||||
// ((WSFace*)face)->SetCenter(center);
|
||||
// ((WSFace*)face)->setCenter(center);
|
||||
|
||||
return face;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user