Skip to content

Commit c99e2bf

Browse files
author
Haydelj
committed
fixed various issues brought up by @dcwhite
1 parent 3cfb573 commit c99e2bf

File tree

6 files changed

+22
-30
lines changed

6 files changed

+22
-30
lines changed

src/Interface/Modules/Render/ES/SRCamera.cc

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,6 @@ namespace SCIRun {
7474
setClippingPlanes();
7575
}
7676

77-
//----------------------------------------------------------------------------------------------
78-
void SRCamera::setViewMat(glm::mat4 view)
79-
{
80-
//mArcLookAt->setView(view[2].xyz(), up);
81-
setClippingPlanes();
82-
}
83-
8477
//----------------------------------------------------------------------------------------------
8578
void SRCamera::mouseDownEvent(const glm::ivec2& pos, SRInterface::MouseButton btn)
8679
{

src/Interface/Modules/Render/ES/SRCamera.h

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,6 @@ namespace SCIRun{
7272
/// Sets the selected View of the window to given up axis and view axis
7373
void setView(const glm::vec3& view, const glm::vec3& up);
7474

75-
void setViewMat(glm::mat4 view);
76-
7775
/// Toggles the zoom controls on New Mouse Controls Inverted/Not Inverted
7876
void setZoomInverted(bool value);
7977

@@ -97,14 +95,14 @@ namespace SCIRun{
9795
float getAspect() {return static_cast<float>(mInterface.getScreenWidthPixels()) /
9896
static_cast<float>(mInterface.getScreenHeightPixels());}
9997

100-
float getDistance() {return mArcLookAt->getDistance();}
101-
void setDistance(float f) {mArcLookAt->setDistance(f);}
98+
float getDistance() const {return mArcLookAt->getDistance();}
99+
void setDistance(const float f) {mArcLookAt->setDistance(f);}
102100

103-
glm::vec3 getLookAt() {return mArcLookAt->getLookAt();}
104-
void setLookAt(glm::vec3 v) {mArcLookAt->setLookAt(v);}
101+
glm::vec3 getLookAt() const {return mArcLookAt->getLookAt();}
102+
void setLookAt(const glm::vec3 v) {mArcLookAt->setLookAt(v);}
105103

106-
glm::quat getRotation() {return mArcLookAt->getRotation();}
107-
void setRotation(glm::quat q) {mArcLookAt->setRotation(q);}
104+
glm::quat getRotation() const {return mArcLookAt->getRotation();}
105+
void setRotation(const glm::quat q) {mArcLookAt->setRotation(q);}
108106

109107
void setLockZoom(bool lock) {lockZoom_ = lock;}
110108
void setLockPanning(bool lock) {lockPanning_ = lock;}

src/Interface/Modules/Render/ES/SRInterface.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -322,12 +322,12 @@ namespace SCIRun {
322322
}
323323

324324
//Getters/Setters-------------------------------------------------------------------------------
325-
void SRInterface::setCameraDistance(float distance) {mCamera->setDistance(distance);}
326-
float SRInterface::getCameraDistance() {return mCamera->getDistance();}
327-
void SRInterface::setCameraLookAt(glm::vec3 lookAt) {mCamera->setLookAt(lookAt);}
328-
glm::vec3 SRInterface::getCameraLookAt() {return mCamera->getLookAt();}
329-
void SRInterface::setCameraRotation(glm::quat roation) {mCamera->setRotation(roation);}
330-
glm::quat SRInterface::getCameraRotation() {return mCamera->getRotation();}
325+
void SRInterface::setCameraDistance(const float distance) {mCamera->setDistance(distance);}
326+
float SRInterface::getCameraDistance() const {return mCamera->getDistance();}
327+
void SRInterface::setCameraLookAt(const glm::vec3 lookAt) {mCamera->setLookAt(lookAt);}
328+
glm::vec3 SRInterface::getCameraLookAt() const {return mCamera->getLookAt();}
329+
void SRInterface::setCameraRotation(const glm::quat roation) {mCamera->setRotation(roation);}
330+
glm::quat SRInterface::getCameraRotation() const {return mCamera->getRotation();}
331331
void SRInterface::setAutoRotateSpeed(double speed) { autoRotateSpeed = speed; }
332332
void SRInterface::setAutoRotateOnDrag(bool value) { doAutoRotateOnDrag = value; }
333333
void SRInterface::setZoomInverted(bool value) {mCamera->setZoomInverted(value);}

src/Interface/Modules/Render/ES/SRInterface.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,12 @@ namespace SCIRun {
125125
void eventResize(size_t width, size_t height);
126126
void doAutoView();
127127
// Sets the selected View of the window
128-
void setCameraDistance(float distance);
129-
float getCameraDistance();
130-
void setCameraLookAt(glm::vec3 lookAt);
131-
glm::vec3 getCameraLookAt();
132-
void setCameraRotation(glm::quat rotation);
133-
glm::quat getCameraRotation();
128+
void setCameraDistance(const float distance);
129+
float getCameraDistance() const;
130+
void setCameraLookAt(const glm::vec3 lookAt);
131+
glm::vec3 getCameraLookAt() const;
132+
void setCameraRotation(const glm::quat rotation);
133+
glm::quat getCameraRotation() const;
134134
void setView(const glm::vec3& view, const glm::vec3& up);
135135
void setZoomSpeed(int zoomSpeed) {mZoomSpeed = zoomSpeed;}
136136
void setZoomInverted(bool value);

src/Interface/Modules/Render/ViewScene.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,6 @@ void ViewSceneDialog::wheelEvent(QWheelEvent* event)
854854
updateModifiedGeometries();
855855
}
856856

857-
//pushCameraState();
858857
auto spire = mSpire.lock();
859858
if(!spire) return;
860859
state_->setValue(Modules::Render::ViewScene::CameraDistance, (double)spire->getCameraDistance());
@@ -1938,8 +1937,11 @@ void ViewSceneDialog::setSpecularValue(double value)
19381937
//--------------------------------------------------------------------------------------------------
19391938
void ViewSceneDialog::setShininessValue(double value)
19401939
{
1940+
const static int maxSpecExp = 40;
1941+
const static int minSpecExp = 1;
19411942
state_->setValue(Modules::Render::ViewScene::Shine, value);
1942-
setMaterialFactor(SRInterface::MAT_SHINE, value * value * 39 + 1);
1943+
//taking square of value makes the ui a little more intuitive in my opinion
1944+
setMaterialFactor(SRInterface::MAT_SHINE, value * value * (maxSpecExp - minSpecExp) + minSpecExp);
19431945
updateAllGeometries();
19441946
}
19451947

src/Interface/Modules/Render/ViewScene.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ DEALINGS IN THE SOFTWARE.
3939
#include <Interface/Modules/Render/ViewSceneControlsDock.h>
4040
#include <Graphics/Datatypes/GeometryImpl.h>
4141
#include <Interface/Modules/Render/share.h>
42-
#include <glm/gtc/quaternion.hpp>
4342

4443
//TODO: needs to inherit from ModuleWidget somehow
4544
class QToolBar;

0 commit comments

Comments
 (0)