Commit 8ad8a54f authored by Matthias Möller's avatar Matthias Möller
Browse files

move exported functions to cc file

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@21054 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 9f1eb5b6
...@@ -154,12 +154,294 @@ namespace Viewer { ...@@ -154,12 +154,294 @@ namespace Viewer {
int ViewerProperties::viewerId() { int ViewerProperties::viewerId() {
return viewerId_; return viewerId_;
}; }
void ViewerProperties::viewerId(int _id) { void ViewerProperties::viewerId(int _id) {
viewerId_ = _id; viewerId_ = _id;
settingsSection_ = "Viewer" + QString::number(_id) + "/"; settingsSection_ = "Viewer" + QString::number(_id) + "/";
}
void ViewerProperties::drawMode(ACG::SceneGraph::DrawModes::DrawMode _mode) {
currentDrawMode_ = _mode;
emit updated();
emit drawModeChanged(viewerId_);
}
ACG::SceneGraph::DrawModes::DrawMode ViewerProperties::drawMode() {
return currentDrawMode_;
}
void ViewerProperties::snapshotCounter(const int _counter){
snapshotCounter_ = _counter;
}
QString ViewerProperties::snapshotFileType() {
return snapshotFileType_;
}
QString ViewerProperties::snapshotName() {
return snapshotName_;
}
int ViewerProperties::snapshotCounter() {
return snapshotCounter_++;
}
double ViewerProperties::wheelZoomFactor() {
return wZoomFactor_;
}
double ViewerProperties::wheelZoomFactorShift() {
return wZoomFactorShift_;
}
void ViewerProperties::wheelZoomFactor(double _factor) {
wZoomFactor_ = _factor;
}
void ViewerProperties::wheelZoomFactorShift(double _factor) {
wZoomFactorShift_ = _factor;
}
bool ViewerProperties::wheelInvert() {
return wInvert_;
}
void ViewerProperties::wheelInvert(bool _invert) {
wInvert_ = _invert;
}
bool ViewerProperties::isCCWFront(){
return CCWFront_;
}
void ViewerProperties::ccwFront() {
CCWFront_ = true;
emit updated();
}
void ViewerProperties::cwFront() {
CCWFront_ = false;
emit updated();
}
ACG::Vec4f ViewerProperties::backgroundColor() {
return backgroundColor_;
}
QRgb ViewerProperties::backgroundColorRgb(){
QColor c;
c.setRedF( backgroundColor_[0]);
c.setGreenF(backgroundColor_[1]);
c.setBlueF( backgroundColor_[2]);
c.setAlphaF(backgroundColor_[3]);
return c.rgba();
}
QColor ViewerProperties::backgroundQColor(){
QColor c;
c.setRedF( backgroundColor_[0]);
c.setGreenF(backgroundColor_[1]);
c.setBlueF( backgroundColor_[2]);
c.setAlphaF(backgroundColor_[3]);
return c;
}
void ViewerProperties::backgroundColor( ACG::Vec4f _color ) {
backgroundColor_ = _color; emit updated();
}; };
void ViewerProperties::backgroundColor( QRgb _color ) {
QColor c(_color);
backgroundColor_[0] = c.redF();
backgroundColor_[1] = c.greenF();
backgroundColor_[2] = c.blueF();
backgroundColor_[3] = c.alphaF();
emit updated();
}
void ViewerProperties::backgroundColor( QColor _color ) {
backgroundColor_[0] = _color.redF();
backgroundColor_[1] = _color.greenF();
backgroundColor_[2] = _color.blueF();
backgroundColor_[3] = _color.alphaF();
emit updated();
}
void ViewerProperties::lockUpdate() {
locked_++;
}
void ViewerProperties::unLockUpdate(){
locked_-- ;
if ( locked_ <0 ) {
std::cerr << "More unlocks then locks" << std::endl;
locked_ = 0;
}
}
bool ViewerProperties::updateLocked() {
return (locked_ != 0);
}
bool ViewerProperties::backFaceCulling() {
return backFaceCulling_;
}
void ViewerProperties::backFaceCulling(bool _state ) {
backFaceCulling_ = _state;
emit updated();
}
void ViewerProperties::twoSidedLighting(bool _state ) {
twoSidedLighting_ = _state;
emit updated();
}
bool ViewerProperties::twoSidedLighting() {
return twoSidedLighting_;
}
void ViewerProperties::multisampling(bool _state ) {
multisampling_ = _state;
emit updated();
}
bool ViewerProperties::multisampling() {
return multisampling_;
}
void ViewerProperties::mipmapping(bool _state ) {
glState_->allow_mipmapping(_state); mipmapping_ = _state; emit updated();
}
bool ViewerProperties::mipmapping() {
return mipmapping_;
}
void ViewerProperties::animation(bool _state ) {
animation_ = _state;
emit updated();
}
bool ViewerProperties::animation() {
return animation_;
}
ACG::GLState& ViewerProperties::glState() {
return (*glState_);
}
const ACG::GLState& ViewerProperties::glState() const {
return (*glState_);
}
void ViewerProperties::setglState(ACG::GLState* _glState) {
glState_ = _glState;
}
void ViewerProperties::objectMarker (ViewObjectMarker* _marker) {
objectMarker_ = _marker;
emit updated();
}
ViewObjectMarker* ViewerProperties::objectMarker() {
return objectMarker_;
}
double ViewerProperties::orthoWidth() {
return orthoWidth_;
}
void ViewerProperties::orthoWidth(double _width){
orthoWidth_ = _width;
emit updated();
}
double ViewerProperties::nearPlane(){
return nearPlane_;
}
void ViewerProperties::setPlanes( double _near, double _far ) {
nearPlane_ = _near;
farPlane_ = _far;
emit updated();
}
double ViewerProperties::farPlane(){
return farPlane_;
}
ACG::Vec3d ViewerProperties::sceneCenter(){
return sceneCenter_;
}
void ViewerProperties::sceneCenter(ACG::Vec3d _center){
sceneCenter_ = _center;
emit updated();
}
double ViewerProperties::sceneRadius() {
return sceneRadius_;
}
void ViewerProperties::sceneRadius(double _radius ) {
sceneRadius_ = _radius;
emit updated();}
ACG::Vec3d ViewerProperties::trackballCenter(){
return trackballCenter_;
}
void ViewerProperties::trackballCenter(ACG::Vec3d _center){
trackballCenter_ = _center;
emit updated();
}
double ViewerProperties::trackballRadius() {
return trackballRadius_;
}
void ViewerProperties::trackballRadius(double _radius ) {
trackballRadius_ = _radius; emit updated();
}
void ViewerProperties::stereo(bool _stereo) {
stereo_ = _stereo;
emit updated();
}
bool ViewerProperties::stereo() {
return stereo_;
}
CursorPainter* ViewerProperties::cursorPainter() {
return cursorPainter_;
}
void ViewerProperties::cursorPainter( CursorPainter* _painter ) {
cursorPainter_ = _painter;
}
ACG::Vec3d ViewerProperties::cursorPoint3D() {
return cursorPoint3D_;
}
void ViewerProperties::cursorPoint3D(ACG::Vec3d _pos) {
cursorPoint3D_ = _pos;
}
bool ViewerProperties::cursorPositionValid() {
return cursorPositionValid_;
}
void ViewerProperties::cursorPositionValid(bool _valid) {
cursorPositionValid_ = _valid;
}
} }
...@@ -131,12 +131,10 @@ namespace Viewer { ...@@ -131,12 +131,10 @@ namespace Viewer {
public: public:
/// set draw mode (No test if this mode is available!) /// set draw mode (No test if this mode is available!)
void drawMode(ACG::SceneGraph::DrawModes::DrawMode _mode) { currentDrawMode_ = _mode; void drawMode(ACG::SceneGraph::DrawModes::DrawMode _mode);
emit updated();
emit drawModeChanged(viewerId_); };
/// get current draw mode /// get current draw mode
ACG::SceneGraph::DrawModes::DrawMode drawMode() { return currentDrawMode_; }; ACG::SceneGraph::DrawModes::DrawMode drawMode();
private: private:
...@@ -164,16 +162,16 @@ namespace Viewer { ...@@ -164,16 +162,16 @@ namespace Viewer {
void snapshotFileType(const QString& _type); void snapshotFileType(const QString& _type);
/** Set the start index for the snapshot counter */ /** Set the start index for the snapshot counter */
void snapshotCounter(const int _counter){snapshotCounter_ = _counter;}; void snapshotCounter(const int _counter);
/** Get the file type for the current snapshot */ /** Get the file type for the current snapshot */
QString snapshotFileType() { return snapshotFileType_; }; QString snapshotFileType();
/** Get the name for the current snapshot */ /** Get the name for the current snapshot */
QString snapshotName() { return snapshotName_; }; QString snapshotName();
/** Get the counter for the current snapshot and increases the counter */ /** Get the counter for the current snapshot and increases the counter */
int snapshotCounter() { return snapshotCounter_++; }; int snapshotCounter();
private: private:
QString snapshotName_; QString snapshotName_;
...@@ -192,22 +190,22 @@ namespace Viewer { ...@@ -192,22 +190,22 @@ namespace Viewer {
public slots: public slots:
/// Zoom factor when using mouse wheel /// Zoom factor when using mouse wheel
double wheelZoomFactor() { return wZoomFactor_; }; double wheelZoomFactor();
/// Zoom factor when using mouse wheel and pressing shift /// Zoom factor when using mouse wheel and pressing shift
double wheelZoomFactorShift() { return wZoomFactorShift_; }; double wheelZoomFactorShift();
/// Set zoom factor when using mouse wheel /// Set zoom factor when using mouse wheel
void wheelZoomFactor(double _factor) { wZoomFactor_ = _factor; }; void wheelZoomFactor(double _factor);
/// Set zoom factor when using mouse wheel and pressing shift /// Set zoom factor when using mouse wheel and pressing shift
void wheelZoomFactorShift(double _factor) { wZoomFactorShift_ = _factor; }; void wheelZoomFactorShift(double _factor);
/// Invert mouse wheel direction? /// Invert mouse wheel direction?
bool wheelInvert() { return wInvert_; }; bool wheelInvert();
/// Invert mouse wheel direction /// Invert mouse wheel direction
void wheelInvert(bool _invert) { wInvert_ = _invert; }; void wheelInvert(bool _invert);
private: private:
double wZoomFactor_; double wZoomFactor_;
...@@ -237,12 +235,12 @@ namespace Viewer { ...@@ -237,12 +235,12 @@ namespace Viewer {
public slots: public slots:
/** true if counter clockwise orientation should be used to define front facing orientation. /** true if counter clockwise orientation should be used to define front facing orientation.
*/ */
bool isCCWFront(){ return CCWFront_; }; bool isCCWFront();
/// Set counter clockwise orientation as front /// Set counter clockwise orientation as front
void ccwFront() { CCWFront_ = true; emit updated(); }; void ccwFront();
/// Set clockwise orientation as front /// Set clockwise orientation as front
void cwFront() { CCWFront_ = false; emit updated(); }; void cwFront();
private: private:
bool CCWFront_; bool CCWFront_;
...@@ -253,44 +251,25 @@ namespace Viewer { ...@@ -253,44 +251,25 @@ namespace Viewer {
public slots: public slots:
/// Get current background color /// Get current background color
ACG::Vec4f backgroundColor() { return backgroundColor_; } ACG::Vec4f backgroundColor();
/// Get current background color /// Get current background color
QRgb backgroundColorRgb(){ QColor c; QRgb backgroundColorRgb();
c.setRedF( backgroundColor_[0]);
c.setGreenF(backgroundColor_[1]);
c.setBlueF( backgroundColor_[2]);
c.setAlphaF(backgroundColor_[3]);
return c.rgba(); };
/// Get current background color /// Get current background color
QColor backgroundQColor(){ QColor c; QColor backgroundQColor();
c.setRedF( backgroundColor_[0]);
c.setGreenF(backgroundColor_[1]);
c.setBlueF( backgroundColor_[2]);
c.setAlphaF(backgroundColor_[3]);
return c; }
/** Set background color. /** Set background color.
*/ */
void backgroundColor( ACG::Vec4f _color ) { backgroundColor_ = _color; emit updated(); }; void backgroundColor( ACG::Vec4f _color );
/** Set background color. /** Set background color.
*/ */
void backgroundColor( QRgb _color ) { QColor c(_color); void backgroundColor( QRgb _color );
backgroundColor_[0] = c.redF();
backgroundColor_[1] = c.greenF();
backgroundColor_[2] = c.blueF();
backgroundColor_[3] = c.alphaF();
emit updated(); };
/** Set background color. /** Set background color.
*/ */
void backgroundColor( QColor _color ) { backgroundColor_[0] = _color.redF(); void backgroundColor( QColor _color );
backgroundColor_[1] = _color.greenF();
backgroundColor_[2] = _color.blueF();
backgroundColor_[3] = _color.alphaF();
emit updated(); };
private: private:
ACG::Vec4f backgroundColor_; ACG::Vec4f backgroundColor_;
...@@ -304,20 +283,14 @@ namespace Viewer { ...@@ -304,20 +283,14 @@ namespace Viewer {
and updateGL() will have no effect! This is true until the display is and updateGL() will have no effect! This is true until the display is
unlockUpdate()'ed. unlockUpdate()'ed.
*/ */
void lockUpdate() { locked_++; }; void lockUpdate();
/// Unlock display locked by updateLock(). /// Unlock display locked by updateLock().
void unLockUpdate(){ void unLockUpdate();
locked_-- ;
if ( locked_ <0 ) {
std::cerr << "More unlocks then locks" << std::endl;
locked_ = 0;
}
};
/** Are updateDisplayList() and updateGL() locked? /** Are updateDisplayList() and updateGL() locked?
(c.f. lockUpdate()) */ (c.f. lockUpdate()) */
bool updateLocked() { return (locked_ != 0); }; bool updateLocked();
private: private:
int locked_; int locked_;
...@@ -327,10 +300,10 @@ namespace Viewer { ...@@ -327,10 +300,10 @@ namespace Viewer {
public slots: public slots:
/// Get current state of backface culling /// Get current state of backface culling
bool backFaceCulling() { return backFaceCulling_; }; bool backFaceCulling();
/// Enable or disable backface culling /// Enable or disable backface culling
void backFaceCulling(bool _state ) { backFaceCulling_ = _state; emit updated(); } void backFaceCulling(bool _state );
private: private:
bool backFaceCulling_; bool backFaceCulling_;
...@@ -339,10 +312,10 @@ namespace Viewer { ...@@ -339,10 +312,10 @@ namespace Viewer {
public slots: public slots:
/// set 2-sided lighting on/off /// set 2-sided lighting on/off
void twoSidedLighting(bool _state ) { twoSidedLighting_ = _state; emit updated(); } void twoSidedLighting(bool _state );
/// is 2-sided lighing enabled? /// is 2-sided lighing enabled?
bool twoSidedLighting() { return twoSidedLighting_; }; bool twoSidedLighting();
private: private:
bool twoSidedLighting_; bool twoSidedLighting_;
...@@ -351,10 +324,10 @@ namespace Viewer { ...@@ -351,10 +324,10 @@ namespace Viewer {
public slots: public slots:
/// set multisampling on/off /// set multisampling on/off
void multisampling(bool _state ) { multisampling_ = _state; emit updated(); } void multisampling(bool _state );
/// is multisampling enabled? /// is multisampling enabled?
bool multisampling() { return multisampling_; }; bool multisampling();
private: private:
bool multisampling_; bool multisampling_;
...@@ -363,10 +336,10 @@ namespace Viewer { ...@@ -363,10 +336,10 @@ namespace Viewer {
public slots: public slots:
/// set mipmapping on/off /// set mipmapping on/off
void mipmapping(bool _state ) { glState_->allow_mipmapping(_state); mipmapping_ = _state; emit updated(); } void mipmapping(bool _state );
/// is mipmapping enabled? /// is mipmapping enabled?
bool mipmapping() { return mipmapping_; }; bool mipmapping();
private: private:
bool mipmapping_; bool mipmapping_;
...@@ -375,10 +348,10 @@ namespace Viewer { ...@@ -375,10 +348,10 @@ namespace Viewer {
public slots: public slots:
/// set 2-sided lighting on/off /// set 2-sided lighting on/off
void animation(bool _state ) { animation_ = _state; emit updated(); } void animation(bool _state );
/// is 2-sided lighing enabled? /// is 2-sided lighing enabled?
bool animation() { return animation_; }; bool animation();
private: private:
bool animation_; bool animation_;
...@@ -388,10 +361,10 @@ namespace Viewer { ...@@ -388,10 +361,10 @@ namespace Viewer {
public: public:
/// Get the glState of the Viewer /// Get the glState of the Viewer
ACG::GLState& glState() { return (*glState_); }; ACG::GLState& glState();
const ACG::GLState& glState() const { return (*glState_); }; const ACG::GLState& glState() const;
void setglState(ACG::GLState* _glState) { glState_ = _glState; }; void setglState(ACG::GLState* _glState);
private: private:
/// Pointer to the glState of the Viewer /// Pointer to the glState of the Viewer
...@@ -401,10 +374,10 @@ namespace Viewer { ...@@ -401,10 +374,10 @@ namespace Viewer {