16 #include "cinder/app/App.h" 17 #include "cinder/app/RendererGl.h" 18 #include "cinder/gl/gl.h" 20 #include "cinder/gl/gl.h" 24 #include "cinder/Camera.h" 25 #include "cinder/GeomIo.h" 26 #include "cinder/ImageIo.h" 27 #include "cinder/CameraUi.h" 30 #include "cinder/gl/Batch.h" 31 #include "cinder/gl/Context.h" 32 #include "cinder/gl/GlslProg.h" 33 #include "cinder/gl/Texture.h" 34 #include "cinder/gl/VboMesh.h" 35 #include "cinder/params/Params.h" 36 #include "cinder/Log.h" 37 #include "cinder/Json.h" 41 #include "cinder/ObjLoader.h" 47 #include <boost/filesystem.hpp> 49 #include "vis2enums.h" 66 void setup()
override;
68 void setupLabelList();
71 void resize()
override;
72 void update()
override;
76 void mouseDown(MouseEvent event)
override;
77 void mouseUp(MouseEvent event)
override;
79 void mouseDrag(MouseEvent event)
override;
80 void mouseWheel(MouseEvent event)
override;
81 void keyDown(KeyEvent event)
override;
82 void mouseMove(MouseEvent event)
override;
85 void moveCameraPosLinear(CameraPersp newCam);
88 void loadObj(
const DataSourceRef& dataSource);
89 void loadObj(
const DataSourceRef &dataSourceObj,
const DataSourceRef &dataSourceMtl);
94 void updateViewInterface()
const;
96 void createGridLoop();
99 void selectObjFileDialog();
102 bool performPicking(vec3 *pickedPoint, vec3 *pickedNormal)
const;
105 void buttonLoadModel();
108 vec3 mCameraTarget, mCameraLerpTarget, mCameraViewDirection;
111 vector<gl::BatchRef> mVecBatchRef;
112 vector<gl::VertBatchRef> mVecVertBatchRef;
114 gl::VertBatchRef mObjectVertBatch;
115 gl::BatchRef mObjectBatch;
120 gl::BatchRef mPrimitive;
121 gl::BatchRef mPrimitiveWire;
122 gl::BatchRef mPrimitiveWireframe;
123 gl::BatchRef mPrimitiveNormalLines, mPrimitiveTangentLines;
125 gl::GlslProgRef mPhongShader;
126 gl::GlslProgRef mWireShader;
127 gl::GlslProgRef mWireframeShader;
128 gl::GlslProgRef *mCurrentShader;
129 gl::GlslProgRef mFlatShader;
158 bool mCutEnabled =
true;
160 vector<string> cutsLabelList;
161 vector<sCut> cutsList;
167 params::InterfaceGlRef mOptions;
168 params::InterfaceGlRef mCameraSettings;
169 params::InterfaceGlRef mCutSettings;
170 params::InterfaceGlRef mViewSettings;
172 params::InterfaceGlRef mRigs;
175 shaderSetting mShaderSetting;
179 TriMeshRef mCurrentTriMesh;
181 cinder::gl::VboMeshRef mCurrentVboMesh;
184 bool mEnablePlaneCut;
187 vec4 mPlaneCutParams;
192 vec3 mMouseDrawPoint;
193 vec3 mMouseDrawPickedNormal;
211 string mCurrentModelPath;
213 Color mBackgroundColor;
215 bool mEnableFaceCulling;
218 std::string mModelFile;
219 std::string mModelMtl;
220 std::string mJsonFile;
225 gl::VertBatchRef mGridLoop;
226 gl::VertBatchRef mGrid;
229 TexType mTextureType;
240 vec2 mMouseStartPoint;
244 gl::BatchRef mCutWireBatch;
246 AxisAlignedBox mObjectBounds;
Definition: Vis2File.cpp:13