00001 #ifndef JVIEWER_H 00002 #define JVIEWER_H 00003 /* 00004 ___ ___ 00005 | \ \ / (_) 00006 | |\ \ / / _ _____ _____ _ __ 00007 _ | | \ \/ / | |/ _ \ \ /\ / / _ \ '__| 00008 | |__| | \ / | | __/\ V V / __/ | 00009 \____/ \/ |_|\___| \_/\_/ \___|_| 00010 */ 00011 #include "global.h" 00012 #include "TableTranslator.h" 00013 #include "SelectableThing.h" 00014 #include "BaryPatch.h" 00015 #include "TDPoint.h" 00016 #include <QGLViewer/qglviewer.h> 00017 #include "QGLViewer/vec.h" 00018 #include <qobject.h> 00019 using namespace std; 00020 using namespace qglviewer; 00021 00023 class SubdivSchemeEditor : public QGLViewer//, public QObject 00024 { 00025 Q_OBJECT 00029 public : 00030 00032 00033 SubdivSchemeEditor(QWidget *parent, const char *name); 00035 float _Version; 00037 QString _SaveName; 00039 TDPoint* _ControlPoints[TABLESIZE]; 00041 BaryPatch* _RootPatches[TABLESIZE]; 00043 ManipulatedFrame* _MyManipulatedFrame; 00045 int _SubdivDepth; 00048 SSMatrix** _SubdivResult; 00050 int _SubdivResultSize; 00052 bool _DrawRootPatches; 00054 TableTranslator* _TableT; 00055 //Must be connected in viewerInterface.cpp with the lines : 00056 //TableTranslator* TableTranslator1 = new TableTranslator(SSS_Matrix); 00057 //SubdivSchemeEditor1->_TableT = TableTranslator1; 00059 int _CurrentSubScheme; 00060 00061 // 1D Schemes transformation matrices : 00063 SSMatrix * _SiUmatrices[3]; 00065 int _SiNbTransfos[3]; 00069 int _SiDimU[3]; 00070 // 1D schemes patch morphology : 00072 int _SiUStart[3]; 00074 int _SiUStop[3]; 00076 bool _SiICnx[3]; 00078 bool _SiBCnx[3]; 00079 00085 SSMatrix *** _S1xS2xS3TransfoMatrices; 00087 int _S1xS2xS3BuildDimU; 00089 int _S1xS2xS3BuildDimV; 00091 int _S1xS2xS3BuildDimW; 00092 00094 int _SampleMeshUSize; 00096 int _SampleMeshVSize; 00098 int _SampleMeshWSize; 00099 00103 int _CurrentMatrixU; 00106 int _CurrentMatrixV; 00109 int _CurrentMatrixW; 00111 00115 int _DrawMode; 00116 00117 protected : 00119 int GetFreePointName(); 00121 int CreatePoint(Vec Position); 00123 int GetFreePatchName(); 00125 QString helpString() const; 00127 virtual void init(); 00129 virtual void draw(); 00130 virtual void fastDraw(); 00132 virtual void drawWithNames(); 00134 void drawSubdivResult(); 00136 Vec SelectionCenterOfGravity(); 00139 void postSelection(const QPoint& point); 00141 void ReCreateSampleMesh(int SizeU, int SizeV, int Size); 00143 void UpdateMatrixVizu(); 00145 void BuildSubdivResult(); 00147 void RecursiveBuildSubdivResult(int CurrentLevel, int MaxLevel, int &CurrentFillingIndice, SSMatrix* CurrentMatrix); 00149 void SubdivSchemeEditor::keyPressEvent(QKeyEvent *e); 00150 00151 public slots: 00154 S_SaveSubdivScheme(); 00157 S_LoadSubdivScheme(); 00159 S_ChangeSaveName(const QString& Name); 00163 S_ChangeCurrentSubScheme(int SS); 00165 S_ChangeCurrentMatrixU(int MU); 00167 S_ChangeCurrentMatrixV(int MV); 00169 S_ChangeCurrentMatrixW(int MW); 00171 S_ChangeNbTransfos(int NT); 00173 S_ChangePatchDim(int PD); 00175 S_ChangeCnx1(int Cn); 00177 S_ChangeCnx2(int Cn); 00179 S_ChangeMatrixValue(int L,int C); 00181 S_RebuildUVW(); 00183 S_ChangeSampleMeshUSize(int Size); 00185 S_ChangeSampleMeshVSize(int Size); 00187 S_ChangeSampleMeshWSize(int Size); 00189 S_ChangeSubdivDepth(int Depth); 00192 S_ChangeDrawMode(int DrawMode); 00193 00194 signals : 00196 void S_DisplayQstring(const QString & Q); 00198 void S_FitMatrixColumnWidth(int i); 00200 void S_FitMatrixColumnHeight(int i); 00202 void S_SetCurrentMatrixU(int MU); 00204 void S_SetCurrentMatrixV(int MV); 00206 void S_SetCurrentMatrixW(int MW); 00208 void S_SetPatchDim(int PD); 00210 void S_SetPatchCnx1(int PC); 00212 void S_SetPatchCnx2(int PC); 00214 void S_SetNbTransfos(int NbT); 00216 void S_SetICnx(bool ICnx); 00218 void S_SetBCnx(bool BCnx); 00220 void S_EnableSave(bool B); 00222 void S_EnablePatchDim(bool B); 00224 void S_EnablePatchCnx(bool B); 00226 void S_EnableNbTransfo(bool B); 00228 void S_EnableSwitchVWTransfo(bool B); 00230 void S_EnableMatrix(bool B); 00231 00232 }; 00233 00234 #endif