mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
System : Avoid file global variables (cotire)
When multiple files defines the same variable in global file scope, a name clash happens in cotire. Prefer using static const members instead.
This commit is contained in:
@@ -53,10 +53,12 @@
|
||||
|
||||
CAF_PDM_SOURCE_INIT(Rim2dIntersectionView, "Intersection2dView");
|
||||
|
||||
const cvf::Mat4d defaultViewMatrix(1, 0, 0, 0,
|
||||
0, 0, 1, 0,
|
||||
0, -1, 0, 1000,
|
||||
0, 0, 0, 1);
|
||||
|
||||
const cvf::Mat4d Rim2dIntersectionView::sm_defaultViewMatrix = cvf::Mat4d(1, 0, 0, 0,
|
||||
0, 0, 1, 0,
|
||||
0, -1, 0, 1000,
|
||||
0, 0, 0, 1);
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@@ -94,7 +96,7 @@ Rim2dIntersectionView::Rim2dIntersectionView(void)
|
||||
|
||||
hasUserRequestedAnimation = true;
|
||||
|
||||
((RiuViewerToViewInterface*)this)->setCameraPosition(defaultViewMatrix );
|
||||
((RiuViewerToViewInterface*)this)->setCameraPosition(sm_defaultViewMatrix );
|
||||
|
||||
disableGridBoxField();
|
||||
disablePerspectiveProjectionField();
|
||||
@@ -550,7 +552,7 @@ void Rim2dIntersectionView::createDisplayModel()
|
||||
updateCurrentTimeStep();
|
||||
}
|
||||
|
||||
if ( this->viewer()->mainCamera()->viewMatrix() == defaultViewMatrix )
|
||||
if ( this->viewer()->mainCamera()->viewMatrix() == sm_defaultViewMatrix )
|
||||
{
|
||||
this->zoomAll();
|
||||
}
|
||||
|
||||
@@ -121,4 +121,6 @@ private:
|
||||
caf::PdmField<bool> m_showAxisLines;
|
||||
|
||||
caf::PdmPointer<caf::PdmObject> m_legendObjectToSelect;
|
||||
|
||||
const static cvf::Mat4d sm_defaultViewMatrix;
|
||||
};
|
||||
|
||||
@@ -43,10 +43,11 @@
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimEclipseContourMapView, "RimContourMapView");
|
||||
|
||||
const cvf::Mat4d defaultViewMatrix(1, 0, 0, 0,
|
||||
0, 1, 0, 0,
|
||||
0, 0, 1, 1000,
|
||||
0, 0, 0, 1);
|
||||
const cvf::Mat4d RimEclipseContourMapView::sm_defaultViewMatrix = cvf::Mat4d(1, 0, 0, 0,
|
||||
0, 1, 0, 0,
|
||||
0, 0, 1, 1000,
|
||||
0, 0, 0, 1);
|
||||
|
||||
|
||||
RimEclipseContourMapView::RimEclipseContourMapView()
|
||||
: m_cameraPositionLastUpdate(cvf::Vec3d::UNDEFINED)
|
||||
@@ -66,7 +67,7 @@ RimEclipseContourMapView::RimEclipseContourMapView()
|
||||
|
||||
m_contourMapProjectionPartMgr = new RivContourMapProjectionPartMgr(contourMapProjection(), this);
|
||||
|
||||
((RiuViewerToViewInterface*)this)->setCameraPosition(defaultViewMatrix);
|
||||
((RiuViewerToViewInterface*)this)->setCameraPosition(sm_defaultViewMatrix);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -181,7 +182,7 @@ void RimEclipseContourMapView::createDisplayModel()
|
||||
updateGeometry();
|
||||
}
|
||||
|
||||
if (this->viewer()->mainCamera()->viewMatrix() == defaultViewMatrix)
|
||||
if (this->viewer()->mainCamera()->viewMatrix() == sm_defaultViewMatrix)
|
||||
{
|
||||
this->zoomAll();
|
||||
}
|
||||
|
||||
@@ -71,5 +71,7 @@ private:
|
||||
caf::PdmField<bool> m_showAxisLines;
|
||||
caf::PdmField<bool> m_showScaleLegend;
|
||||
cvf::Vec3d m_cameraPositionLastUpdate;
|
||||
|
||||
const static cvf::Mat4d sm_defaultViewMatrix;
|
||||
};
|
||||
|
||||
|
||||
@@ -38,10 +38,11 @@
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimGeoMechContourMapView, "RimGeoMechContourMapView");
|
||||
|
||||
const cvf::Mat4d defaultViewMatrix(1, 0, 0, 0,
|
||||
0, 1, 0, 0,
|
||||
0, 0, 1, 1000,
|
||||
0, 0, 0, 1);
|
||||
|
||||
const cvf::Mat4d RimGeoMechContourMapView::sm_defaultViewMatrix = cvf::Mat4d(1, 0, 0, 0,
|
||||
0, 1, 0, 0,
|
||||
0, 0, 1, 1000,
|
||||
0, 0, 0, 1);
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@@ -63,7 +64,7 @@ RimGeoMechContourMapView::RimGeoMechContourMapView()
|
||||
|
||||
m_contourMapProjectionPartMgr = new RivContourMapProjectionPartMgr(contourMapProjection(), this);
|
||||
|
||||
((RiuViewerToViewInterface*)this)->setCameraPosition(defaultViewMatrix);
|
||||
((RiuViewerToViewInterface*)this)->setCameraPosition(sm_defaultViewMatrix);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -185,7 +186,7 @@ void RimGeoMechContourMapView::createDisplayModel()
|
||||
updateGeometry();
|
||||
}
|
||||
|
||||
if (this->viewer()->mainCamera()->viewMatrix() == defaultViewMatrix)
|
||||
if (this->viewer()->mainCamera()->viewMatrix() == sm_defaultViewMatrix)
|
||||
{
|
||||
this->zoomAll();
|
||||
}
|
||||
|
||||
@@ -71,5 +71,7 @@ private:
|
||||
caf::PdmField<bool> m_showAxisLines;
|
||||
caf::PdmField<bool> m_showScaleLegend;
|
||||
cvf::Vec3d m_cameraPositionLastUpdate;
|
||||
|
||||
const static cvf::Mat4d sm_defaultViewMatrix;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user