mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-18 14:27:39 +03:00
Compare commits
1 Commits
integratio
...
CR0-ipdm-l
Author | SHA1 | Date | |
---|---|---|---|
|
589c66e487 |
@@ -158,10 +158,22 @@ void Graphic3d_TransformPers::Apply (NCollection_Mat4<T>& theProjection,
|
||||
}
|
||||
|
||||
// Prevent zooming.
|
||||
if ((Flags & Graphic3d_TMF_ZoomPers) || (Flags == Graphic3d_TMF_TriedronPers))
|
||||
if (Flags & Graphic3d_TMF_ZoomPers)
|
||||
{
|
||||
const T aDet00 = (2.0f / theViewportWidth) / theProjection.GetValue(0, 0);
|
||||
const T aDet11 = (2.0f / theViewportHeight) / theProjection.GetValue(1, 1);
|
||||
const T aDet2 = Max (aDet00, aDet11);
|
||||
|
||||
theProjection.ChangeValue(0, 0) *= aDet00;
|
||||
theProjection.ChangeValue(1, 1) *= aDet11;
|
||||
theProjection.ChangeValue(2, 2) *= aDet2;
|
||||
}
|
||||
|
||||
if (Flags == Graphic3d_TMF_TriedronPers)
|
||||
{
|
||||
// Compute fixed-zoom multiplier. Actually function works ugly with TelPerspective!
|
||||
const T aDet2 = static_cast<T> (0.002) / Max (theProjection.GetValue (1, 1), theProjection.GetValue (0, 0));
|
||||
|
||||
theProjection.ChangeValue (0, 0) *= aDet2;
|
||||
theProjection.ChangeValue (1, 1) *= aDet2;
|
||||
theProjection.ChangeValue (2, 2) *= aDet2;
|
||||
|
@@ -85,7 +85,7 @@ Standard_Boolean MeshVS_DummySensitiveEntity::HasInitLocation() const
|
||||
//function : InvInitLocation
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline gp_Trsf MeshVS_DummySensitiveEntity::InvInitLocation() const
|
||||
inline gp_GTrsf MeshVS_DummySensitiveEntity::InvInitLocation() const
|
||||
{
|
||||
return gp_Trsf();
|
||||
return gp_GTrsf();
|
||||
}
|
||||
|
@@ -49,7 +49,7 @@ public:
|
||||
|
||||
Standard_EXPORT virtual Standard_Boolean HasInitLocation() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT virtual gp_Trsf InvInitLocation() const Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual gp_GTrsf InvInitLocation() const Standard_OVERRIDE;
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(MeshVS_DummySensitiveEntity,SelectBasics_SensitiveEntity)
|
||||
};
|
||||
|
@@ -135,6 +135,8 @@ const OpenGl_Structure* OpenGl_BVHClipPrimitiveTrsfPersSet::GetStructureById (St
|
||||
const NCollection_Handle<BVH_Tree<Standard_ShortReal, 4> >&
|
||||
OpenGl_BVHClipPrimitiveTrsfPersSet::BVH (const OpenGl_Mat4& theProjectionMatrix,
|
||||
const OpenGl_Mat4& theWorldViewMatrix,
|
||||
const Standard_Integer theViewportWidth,
|
||||
const Standard_Integer theViewportHeight,
|
||||
const Graphic3d_WorldViewProjState& theWVPState)
|
||||
{
|
||||
if (!myIsDirty
|
||||
@@ -152,7 +154,7 @@ const NCollection_Handle<BVH_Tree<Standard_ShortReal, 4> >&
|
||||
|
||||
HBndBox4f aBoundingBox = new Graphic3d_BndBox4f;
|
||||
*aBoundingBox = aStructure->BoundingBox();
|
||||
aStructure->TransformPersistence.Apply (theProjectionMatrix, theWorldViewMatrix, 0, 0, *aBoundingBox);
|
||||
aStructure->TransformPersistence.Apply (theProjectionMatrix, theWorldViewMatrix, theViewportWidth, theViewportHeight, *aBoundingBox);
|
||||
|
||||
myStructBoxes.Add (aBoundingBox);
|
||||
}
|
||||
|
@@ -78,6 +78,8 @@ public:
|
||||
//! Returns BVH tree for the given world view projection (builds it if necessary).
|
||||
const NCollection_Handle<BVH_Tree<Standard_ShortReal, 4> >& BVH (const OpenGl_Mat4& theProjectionMatrix,
|
||||
const OpenGl_Mat4& theWorldViewMatrix,
|
||||
const Standard_Integer theViewportWidth,
|
||||
const Standard_Integer theViewportHeight,
|
||||
const Graphic3d_WorldViewProjState& theWVPState);
|
||||
|
||||
private:
|
||||
|
@@ -122,6 +122,17 @@ void OpenGl_BVHTreeSelector::SetViewVolume (const Handle(Graphic3d_Camera)& theC
|
||||
}
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SetViewportSize
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void OpenGl_BVHTreeSelector::SetViewportSize (const Standard_Integer theViewportWidth,
|
||||
const Standard_Integer theViewportHeight)
|
||||
{
|
||||
myViewportHeight = theViewportHeight;
|
||||
myViewportWidth = theViewportWidth;
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : SignedPlanePointDistance
|
||||
// purpose :
|
||||
|
@@ -33,6 +33,8 @@ public:
|
||||
//! Retrieves view volume's planes equations and its vertices from projection and world-view matrices.
|
||||
Standard_EXPORT void SetViewVolume (const Handle(Graphic3d_Camera)& theCamera);
|
||||
|
||||
Standard_EXPORT void SetViewportSize (const Standard_Integer theViewportWidth, const Standard_Integer theViewportHeight);
|
||||
|
||||
//! Detects if AABB overlaps view volume using separating axis theorem (SAT).
|
||||
//! @param theMinPt [in] maximum point of AABB.
|
||||
//! @param theMaxPt [in] minimum point of AABB.
|
||||
@@ -56,6 +58,16 @@ public:
|
||||
return myWorldViewMat;
|
||||
}
|
||||
|
||||
Standard_Integer ViewportWidth() const
|
||||
{
|
||||
return myViewportWidth;
|
||||
}
|
||||
|
||||
Standard_Integer ViewportHeight() const
|
||||
{
|
||||
return myViewportHeight;
|
||||
}
|
||||
|
||||
//! Returns state of current world view projection transformation matrices.
|
||||
const Graphic3d_WorldViewProjState& WorldViewProjState() const
|
||||
{
|
||||
@@ -118,6 +130,9 @@ protected:
|
||||
OpenGl_Mat4 myProjectionMat;
|
||||
OpenGl_Mat4 myWorldViewMat;
|
||||
|
||||
Standard_Integer myViewportWidth;
|
||||
Standard_Integer myViewportHeight;
|
||||
|
||||
Graphic3d_WorldViewProjState myWorldViewProjState; //!< State of world view projection matrices.
|
||||
};
|
||||
|
||||
|
@@ -489,7 +489,10 @@ void OpenGl_Layer::traverse (OpenGl_BVHTreeSelector& theSelector) const
|
||||
const OpenGl_Mat4& aProjection = theSelector.ProjectionMatrix();
|
||||
const OpenGl_Mat4& aWorldView = theSelector.WorldViewMatrix();
|
||||
const Graphic3d_WorldViewProjState& aWVPState = theSelector.WorldViewProjState();
|
||||
aBVHTree = myBVHPrimitivesTrsfPers.BVH (aProjection, aWorldView, aWVPState);
|
||||
const Standard_Integer aViewportWidth = theSelector.ViewportWidth();
|
||||
const Standard_Integer aViewportHeight = theSelector.ViewportHeight();
|
||||
|
||||
aBVHTree = myBVHPrimitivesTrsfPers.BVH (aProjection, aWorldView, aViewportWidth, aViewportHeight, aWVPState);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -779,6 +779,7 @@ void OpenGl_View::render (Graphic3d_Camera::Projection theProjection,
|
||||
|
||||
// Update states of OpenGl_BVHTreeSelector (frustum culling algorithm).
|
||||
myBVHSelector.SetViewVolume (myCamera);
|
||||
myBVHSelector.SetViewportSize (myWindow->Width(), myWindow->Height());
|
||||
|
||||
const Handle(OpenGl_ShaderManager)& aManager = aContext->ShaderManager();
|
||||
if (StateInfo (myCurrLightSourceState, aManager->LightSourceState().Index()) != myLastLightSourceState)
|
||||
|
@@ -26,6 +26,7 @@
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Graphic3d_ZLayerId.hxx>
|
||||
#include <PrsMgr_PresentableObjectPointer.hxx>
|
||||
#include <gp_GTrsf.hxx>
|
||||
#include <gp_Trsf.hxx>
|
||||
#include <PrsMgr_ListOfPresentableObjects.hxx>
|
||||
#include <MMgt_TShared.hxx>
|
||||
@@ -133,7 +134,7 @@ public:
|
||||
|
||||
const gp_Trsf& Transformation() const;
|
||||
|
||||
const gp_Trsf& InversedTransformation() const;
|
||||
const gp_GTrsf& InversedTransformation() const;
|
||||
|
||||
//! resets local transformation to identity.
|
||||
Standard_EXPORT virtual void ResetTransformation();
|
||||
@@ -288,7 +289,7 @@ private:
|
||||
PrsMgr_PresentableObjectPointer myParent;
|
||||
gp_Trsf myLocalTransformation;
|
||||
gp_Trsf myTransformation;
|
||||
gp_Trsf myInvTransformation;
|
||||
gp_GTrsf myInvTransformation;
|
||||
gp_Trsf myCombinedParentTransform;
|
||||
PrsMgr_ListOfPresentableObjects myChildren;
|
||||
|
||||
|
@@ -32,7 +32,7 @@ inline const gp_Trsf& PrsMgr_PresentableObject::Transformation() const
|
||||
return myTransformation;
|
||||
}
|
||||
|
||||
inline const gp_Trsf& PrsMgr_PresentableObject::InversedTransformation() const
|
||||
inline const gp_GTrsf& PrsMgr_PresentableObject::InversedTransformation() const
|
||||
{
|
||||
return myInvTransformation;
|
||||
}
|
||||
|
@@ -85,7 +85,7 @@ Standard_Boolean Select3D_SensitiveEntity::HasInitLocation() const
|
||||
// purpose : Returns inversed location transformation matrix if the shape corresponding
|
||||
// to this entity has init location set. Otherwise, returns identity matrix.
|
||||
//=======================================================================
|
||||
gp_Trsf Select3D_SensitiveEntity::InvInitLocation() const
|
||||
gp_GTrsf Select3D_SensitiveEntity::InvInitLocation() const
|
||||
{
|
||||
return gp_Trsf();
|
||||
return gp_GTrsf();
|
||||
}
|
||||
|
@@ -83,7 +83,7 @@ public:
|
||||
|
||||
//! Returns inversed location transformation matrix if the shape corresponding
|
||||
//! to this entity has init location set. Otherwise, returns identity matrix.
|
||||
Standard_EXPORT virtual gp_Trsf InvInitLocation() const Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual gp_GTrsf InvInitLocation() const Standard_OVERRIDE;
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(Select3D_SensitiveEntity,SelectBasics_SensitiveEntity)
|
||||
|
||||
|
@@ -208,7 +208,7 @@ public:
|
||||
|
||||
//! Returns inversed location transformation matrix if the shape corresponding
|
||||
//! to this entity has init location set. Otherwise, returns identity matrix.
|
||||
virtual gp_Trsf InvInitLocation() const Standard_OVERRIDE
|
||||
virtual gp_GTrsf InvInitLocation() const Standard_OVERRIDE
|
||||
{
|
||||
return myInvInitLocation;
|
||||
}
|
||||
@@ -261,7 +261,7 @@ private:
|
||||
gp_Pnt myCDG3D; //!< Center of the whole triangulation
|
||||
Select3D_BVHIndexBuffer myBvhIndices; //!< Indexes of edges or triangles for BVH tree
|
||||
mutable Select3D_BndBox3d myBndBox; //!< Bounding box of the whole triangulation
|
||||
gp_Trsf myInvInitLocation;
|
||||
gp_GTrsf myInvInitLocation;
|
||||
Standard_Real myMinDepthElem; //!< the depth of nearest detected element
|
||||
Standard_Real myMinDepthNode; //!< the depth of nearest detected node
|
||||
Standard_Real myMinDepthEdge; //!< the depth of nearest detected edge
|
||||
|
@@ -429,7 +429,7 @@ Standard_Boolean Select3D_SensitiveTriangulation::HasInitLocation() const
|
||||
//function : InvInitLocation
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
gp_Trsf Select3D_SensitiveTriangulation::InvInitLocation() const
|
||||
gp_GTrsf Select3D_SensitiveTriangulation::InvInitLocation() const
|
||||
{
|
||||
return myInvInitLocation;
|
||||
}
|
||||
|
@@ -106,7 +106,7 @@ public:
|
||||
|
||||
//! Returns inversed location transformation matrix if the shape corresponding
|
||||
//! to this entity has init location set. Otherwise, returns identity matrix.
|
||||
Standard_EXPORT virtual gp_Trsf InvInitLocation() const Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual gp_GTrsf InvInitLocation() const Standard_OVERRIDE;
|
||||
|
||||
inline const TopLoc_Location& GetInitLocation() const;
|
||||
|
||||
@@ -144,7 +144,7 @@ private:
|
||||
Standard_Integer myPrimitivesNb; //!< Amount of free edges or triangles depending on sensitivity type
|
||||
Handle(TColStd_HArray1OfInteger) myBVHPrimIndexes; //!< Indexes of edges or triangles for BVH build
|
||||
mutable Select3D_BndBox3d myBndBox; //!< Bounding box of the whole triangulation
|
||||
gp_Trsf myInvInitLocation;
|
||||
gp_GTrsf myInvInitLocation;
|
||||
};
|
||||
|
||||
DEFINE_STANDARD_HANDLE(Select3D_SensitiveTriangulation, Select3D_SensitiveSet)
|
||||
|
@@ -17,6 +17,7 @@
|
||||
#ifndef _SelectBasics_SensitiveEntity_HeaderFile
|
||||
#define _SelectBasics_SensitiveEntity_HeaderFile
|
||||
|
||||
#include <gp_GTrsf.hxx>
|
||||
#include <gp_Trsf.hxx>
|
||||
|
||||
#include <Standard.hxx>
|
||||
@@ -83,7 +84,7 @@ public:
|
||||
|
||||
//! Returns inversed location transformation matrix if the shape corresponding
|
||||
//! to this entity has init location set. Otherwise, returns identity matrix.
|
||||
virtual gp_Trsf InvInitLocation() const = 0;
|
||||
virtual gp_GTrsf InvInitLocation() const = 0;
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(SelectBasics_SensitiveEntity,MMgt_TShared)
|
||||
|
||||
|
@@ -117,6 +117,16 @@ void SelectMgr_BaseFrustum::SetWindowSize (const Standard_Integer theWidth, cons
|
||||
myBuilder->SetWindowSize (theWidth, theHeight);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : WindowSize
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
void SelectMgr_BaseFrustum::WindowSize (Standard_Integer& theWidth,
|
||||
Standard_Integer& theHeight)
|
||||
{
|
||||
myBuilder->WindowSize (theWidth, theHeight);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : SetBuilder
|
||||
// purpose :
|
||||
|
@@ -16,6 +16,7 @@
|
||||
#ifndef _SelectMgr_BaseFrustum_HeaderFile
|
||||
#define _SelectMgr_BaseFrustum_HeaderFile
|
||||
|
||||
#include <gp_GTrsf.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
|
||||
@@ -70,6 +71,9 @@ public:
|
||||
Standard_EXPORT void SetWindowSize (const Standard_Integer theWidth,
|
||||
const Standard_Integer theHeight);
|
||||
|
||||
Standard_EXPORT void WindowSize (Standard_Integer& theWidth,
|
||||
Standard_Integer& theHeight);
|
||||
|
||||
//! Passes viewport parameters to builder
|
||||
Standard_EXPORT void SetViewport (const Standard_Real theX,
|
||||
const Standard_Real theY,
|
||||
@@ -103,7 +107,7 @@ public:
|
||||
//! - transformation only is needed: @theScaleFactor must be initialized as any negative value;
|
||||
//! - scale only is needed: @theTrsf must be set to gp_Identity.
|
||||
Standard_EXPORT virtual NCollection_Handle<SelectMgr_BaseFrustum> ScaleAndTransform (const Standard_Integer /*theScaleFactor*/,
|
||||
const gp_Trsf& /*theTrsf*/) { return NULL; }
|
||||
const gp_GTrsf& /*theTrsf*/) { return NULL; }
|
||||
|
||||
//! SAT intersection test between defined volume and given axis-aligned box
|
||||
Standard_EXPORT virtual Standard_Boolean Overlaps (const SelectMgr_Vec3& theBoxMin,
|
||||
|
@@ -114,6 +114,17 @@ void SelectMgr_FrustumBuilder::SetViewport (const Standard_Real theX,
|
||||
myIsViewportSet = Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : WindowSize
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
void SelectMgr_FrustumBuilder::WindowSize (Standard_Integer& theWidth,
|
||||
Standard_Integer& theHeight)
|
||||
{
|
||||
theWidth = myWidth;
|
||||
theHeight = myHeight;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : InvalidateViewport
|
||||
// purpose :
|
||||
|
@@ -62,6 +62,9 @@ public:
|
||||
|
||||
Standard_EXPORT void InvalidateViewport();
|
||||
|
||||
Standard_EXPORT void WindowSize (Standard_Integer& theWidth,
|
||||
Standard_Integer& theHeight);
|
||||
|
||||
//! Calculates signed distance between plane with equation
|
||||
//! theEq and point thePnt
|
||||
Standard_EXPORT Standard_Real SignedPlanePntDist (const SelectMgr_Vec3& theEq,
|
||||
|
@@ -323,7 +323,7 @@ void SelectMgr_RectangularFrustum::Build (const gp_Pnt2d& theMinPnt,
|
||||
// - scale only is needed: @theTrsf must be set to gp_Identity.
|
||||
// =======================================================================
|
||||
NCollection_Handle<SelectMgr_BaseFrustum> SelectMgr_RectangularFrustum::ScaleAndTransform (const Standard_Integer theScaleFactor,
|
||||
const gp_Trsf& theTrsf)
|
||||
const gp_GTrsf& theTrsf)
|
||||
{
|
||||
Standard_ASSERT_RAISE (theScaleFactor > 0,
|
||||
"Error! Pixel tolerance for selection should be greater than zero");
|
||||
@@ -357,26 +357,24 @@ NCollection_Handle<SelectMgr_BaseFrustum> SelectMgr_RectangularFrustum::ScaleAnd
|
||||
|
||||
if (isToTrsf)
|
||||
{
|
||||
aRes->myNearPickedPnt = aRef->myNearPickedPnt.Transformed (theTrsf);
|
||||
aRes->myFarPickedPnt = aRef->myFarPickedPnt.Transformed (theTrsf);
|
||||
const Standard_Real aRefScale = aRef->myFarPickedPnt.SquareDistance (aRef->myNearPickedPnt);
|
||||
|
||||
gp_Pnt aPoint = aRef->myNearPickedPnt;
|
||||
theTrsf.Transforms (aPoint.ChangeCoord());
|
||||
aRes->myNearPickedPnt = aPoint;
|
||||
|
||||
aPoint.SetXYZ (aRef->myFarPickedPnt.XYZ());
|
||||
theTrsf.Transforms (aPoint.ChangeCoord());
|
||||
aRes->myFarPickedPnt = aPoint;
|
||||
|
||||
aRes->myViewRayDir = aRes->myFarPickedPnt.XYZ() - aRes->myNearPickedPnt.XYZ();
|
||||
|
||||
// LeftTopNear
|
||||
aRes->myVertices[0] = aRef->myVertices[0].Transformed (theTrsf);
|
||||
// LeftTopFar
|
||||
aRes->myVertices[1] = aRef->myVertices[1].Transformed (theTrsf);
|
||||
// LeftBottomNear
|
||||
aRes->myVertices[2] = aRef->myVertices[2].Transformed (theTrsf);
|
||||
// LeftBottomFar
|
||||
aRes->myVertices[3] = aRef->myVertices[3].Transformed (theTrsf);
|
||||
// RightTopNear
|
||||
aRes->myVertices[4] = aRef->myVertices[4].Transformed (theTrsf);
|
||||
// RightTopFar
|
||||
aRes->myVertices[5] = aRef->myVertices[5].Transformed (theTrsf);
|
||||
// RightBottomNear
|
||||
aRes->myVertices[6] = aRef->myVertices[6].Transformed (theTrsf);
|
||||
// RightBottomFar
|
||||
aRes->myVertices[7] = aRef->myVertices[7].Transformed (theTrsf);
|
||||
for (Standard_Integer anIt = 0; anIt < 8; anIt++)
|
||||
{
|
||||
aPoint = aRef->myVertices[anIt];
|
||||
theTrsf.Transforms (aPoint.ChangeCoord());
|
||||
aRes->myVertices[anIt] = aPoint;
|
||||
}
|
||||
|
||||
// Horizontal
|
||||
aRes->myEdgeDirs[0] = aRes->myVertices[4].XYZ() - aRes->myVertices[0].XYZ();
|
||||
@@ -391,7 +389,8 @@ NCollection_Handle<SelectMgr_BaseFrustum> SelectMgr_RectangularFrustum::ScaleAnd
|
||||
// RightUpper
|
||||
aRes->myEdgeDirs[5] = aRes->myVertices[4].XYZ() - aRes->myVertices[5].XYZ();
|
||||
|
||||
aRes->myScale = 1.0 / theTrsf.ScaleFactor();
|
||||
// Compute scale to transform depth from local coordinate system to world coordinate system
|
||||
aRes->myScale = Sqrt (aRefScale / aRes->myFarPickedPnt.SquareDistance (aRes->myNearPickedPnt));
|
||||
}
|
||||
|
||||
// compute frustum normals
|
||||
|
@@ -51,7 +51,7 @@ public:
|
||||
//! - transformation only is needed: @theScaleFactor must be initialized as any negative value;
|
||||
//! - scale only is needed: @theTrsf must be set to gp_Identity.
|
||||
Standard_EXPORT virtual NCollection_Handle<SelectMgr_BaseFrustum> ScaleAndTransform (const Standard_Integer theScaleFactor,
|
||||
const gp_Trsf& theTrsf) Standard_OVERRIDE;
|
||||
const gp_GTrsf& theTrsf) Standard_OVERRIDE;
|
||||
|
||||
|
||||
// SAT Tests for different objects
|
||||
|
@@ -119,6 +119,8 @@ Standard_Boolean SelectMgr_SelectableObjectTrsfPersSet::Remove (const Handle(Sel
|
||||
const NCollection_Handle<BVH_Tree<Standard_Real, 3> >&
|
||||
SelectMgr_SelectableObjectTrsfPersSet::BVH (const Graphic3d_Mat4d& theProjectionMatrix,
|
||||
const Graphic3d_Mat4d& theWorldViewMatrix,
|
||||
const Standard_Integer theViewportWidth,
|
||||
const Standard_Integer theViewportHeight,
|
||||
const Graphic3d_WorldViewProjState& theWVPState)
|
||||
{
|
||||
if (!myIsDirty && (myObjectBoxesState.IsValid() && !myObjectBoxesState.IsChanged(theWVPState)))
|
||||
@@ -139,7 +141,7 @@ const NCollection_Handle<BVH_Tree<Standard_Real, 3> >&
|
||||
anObject->BoundingBox (aBoundingBox);
|
||||
if (!aBoundingBox.IsVoid())
|
||||
{
|
||||
anObject->TransformPersistence().Apply (theProjectionMatrix, theWorldViewMatrix, 0, 0, aBoundingBox);
|
||||
anObject->TransformPersistence().Apply (theProjectionMatrix, theWorldViewMatrix, theViewportWidth, theViewportHeight, aBoundingBox);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -87,6 +87,8 @@ public:
|
||||
//! Returns BVH tree for the given world view projection (builds it if necessary).
|
||||
Standard_EXPORT const NCollection_Handle<BVH_Tree<Standard_Real, 3> >& BVH (const Graphic3d_Mat4d& theProjectionMatrix,
|
||||
const Graphic3d_Mat4d& theWorldViewMatrix,
|
||||
const Standard_Integer theViewportWidth,
|
||||
const Standard_Integer theViewportHeight,
|
||||
const Graphic3d_WorldViewProjState& theWVPState);
|
||||
|
||||
private:
|
||||
|
@@ -44,7 +44,7 @@ SelectMgr_SelectingVolumeManager::SelectMgr_SelectingVolumeManager (Standard_Boo
|
||||
// - scale only is needed: @theTrsf must be set to gp_Identity.
|
||||
//=======================================================================
|
||||
SelectMgr_SelectingVolumeManager SelectMgr_SelectingVolumeManager::ScaleAndTransform (const Standard_Integer theScaleFactor,
|
||||
const gp_Trsf& theTrsf)
|
||||
const gp_GTrsf& theTrsf)
|
||||
{
|
||||
SelectMgr_SelectingVolumeManager aMgr (Standard_False);
|
||||
|
||||
@@ -137,6 +137,15 @@ const Graphic3d_WorldViewProjState& SelectMgr_SelectingVolumeManager::WorldViewP
|
||||
return mySelectingVolumes[Frustum]->WorldViewProjState();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : WindowSize
|
||||
// purpose :
|
||||
//=======================================================================
|
||||
void SelectMgr_SelectingVolumeManager::WindowSize (Standard_Integer& theWidth, Standard_Integer& theHeight)
|
||||
{
|
||||
mySelectingVolumes[Frustum]->WindowSize (theWidth, theHeight);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
// function : SetCamera
|
||||
// purpose : Updates viewport in all selecting volumes
|
||||
|
@@ -47,7 +47,7 @@ public:
|
||||
//! - transformation only is needed: @theScaleFactor must be initialized as any negative value;
|
||||
//! - scale only is needed: @theTrsf must be set to gp_Identity.
|
||||
Standard_EXPORT virtual SelectMgr_SelectingVolumeManager ScaleAndTransform (const Standard_Integer theScaleFactor,
|
||||
const gp_Trsf& theTrsf);
|
||||
const gp_GTrsf& theTrsf);
|
||||
|
||||
Standard_EXPORT virtual Standard_Integer GetActiveSelectionType() const Standard_OVERRIDE;
|
||||
|
||||
@@ -68,6 +68,8 @@ public:
|
||||
//! @return current world view transformation common for all selecting volumes
|
||||
Standard_EXPORT const Graphic3d_Mat4d& WorldViewMatrix() const;
|
||||
|
||||
Standard_EXPORT void WindowSize (Standard_Integer& theWidth, Standard_Integer& theHeight);
|
||||
|
||||
//! @return current camera world view projection transformation state common for all selecting volumes
|
||||
Standard_EXPORT const Graphic3d_WorldViewProjState& WorldViewProjState() const;
|
||||
|
||||
|
@@ -129,22 +129,16 @@ void SelectMgr_TriangularFrustum::Build (const gp_Pnt2d& theP1,
|
||||
// - scale only is needed: @theTrsf must be set to gp_Identity.
|
||||
//=======================================================================
|
||||
NCollection_Handle<SelectMgr_BaseFrustum> SelectMgr_TriangularFrustum::ScaleAndTransform (const Standard_Integer /*theScale*/,
|
||||
const gp_Trsf& theTrsf)
|
||||
const gp_GTrsf& theTrsf)
|
||||
{
|
||||
SelectMgr_TriangularFrustum* aRes = new SelectMgr_TriangularFrustum();
|
||||
|
||||
// V0_Near
|
||||
aRes->myVertices[0] = myVertices[0].Transformed (theTrsf);
|
||||
// V1_Near
|
||||
aRes->myVertices[1] = myVertices[1].Transformed (theTrsf);
|
||||
// V2_Near
|
||||
aRes->myVertices[2] = myVertices[2].Transformed (theTrsf);
|
||||
// V0_Far
|
||||
aRes->myVertices[3] = myVertices[3].Transformed (theTrsf);
|
||||
// V1_Far
|
||||
aRes->myVertices[4] = myVertices[4].Transformed (theTrsf);
|
||||
// V2_Far
|
||||
aRes->myVertices[5] = myVertices[5].Transformed (theTrsf);
|
||||
for (Standard_Integer anIt = 0; anIt < 6; anIt++)
|
||||
{
|
||||
gp_Pnt aPoint = myVertices[anIt];
|
||||
theTrsf.Transforms (aPoint.ChangeCoord());
|
||||
aRes->myVertices[anIt] = aPoint;
|
||||
}
|
||||
|
||||
aRes->myIsOrthographic = myIsOrthographic;
|
||||
|
||||
|
@@ -41,7 +41,7 @@ public:
|
||||
|
||||
//! Returns a copy of the frustum transformed according to the matrix given
|
||||
Standard_EXPORT virtual NCollection_Handle<SelectMgr_BaseFrustum> ScaleAndTransform (const Standard_Integer theScale,
|
||||
const gp_Trsf& theTrsf) Standard_OVERRIDE;
|
||||
const gp_GTrsf& theTrsf) Standard_OVERRIDE;
|
||||
|
||||
// SAT Tests for different objects
|
||||
|
||||
|
@@ -109,7 +109,7 @@ void SelectMgr_TriangularFrustumSet::Build (const TColgp_Array1OfPnt2d& thePoint
|
||||
// - scale only is needed: @theTrsf must be set to gp_Identity.
|
||||
// =======================================================================
|
||||
NCollection_Handle<SelectMgr_BaseFrustum> SelectMgr_TriangularFrustumSet::ScaleAndTransform (const Standard_Integer theScale,
|
||||
const gp_Trsf& theTrsf)
|
||||
const gp_GTrsf& theTrsf)
|
||||
{
|
||||
SelectMgr_TriangularFrustumSet* aRes = new SelectMgr_TriangularFrustumSet();
|
||||
|
||||
|
@@ -48,7 +48,7 @@ public:
|
||||
|
||||
//! Returns a copy of the frustum with all sub-volumes transformed according to the matrix given
|
||||
Standard_EXPORT virtual NCollection_Handle<SelectMgr_BaseFrustum> ScaleAndTransform (const Standard_Integer theScale,
|
||||
const gp_Trsf& theTrsf) Standard_OVERRIDE;
|
||||
const gp_GTrsf& theTrsf) Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT virtual Standard_Boolean Overlaps (const SelectMgr_Vec3& theMinPnt,
|
||||
const SelectMgr_Vec3& theMaxPnt,
|
||||
|
@@ -19,6 +19,7 @@
|
||||
// AGV OCT/23/03 : Optimize the method SortResult() (OCC4201)
|
||||
|
||||
#include <BVH_Tree.hxx>
|
||||
#include <gp_GTrsf.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <OSD_Environment.hxx>
|
||||
#include <Precision.hxx>
|
||||
@@ -267,12 +268,12 @@ void SelectMgr_ViewerSelector::checkOverlap (const Handle(SelectBasics_Sensitive
|
||||
// necessary calculations
|
||||
//=======================================================================
|
||||
void SelectMgr_ViewerSelector::computeFrustum (const Handle(SelectBasics_SensitiveEntity)& theEnt,
|
||||
const gp_Trsf& theInvTrsf,
|
||||
const gp_GTrsf& theInvTrsf,
|
||||
SelectMgr_FrustumCache& theCachedMgrs,
|
||||
SelectMgr_SelectingVolumeManager& theResMgr)
|
||||
{
|
||||
Standard_Integer aScale = isToScaleFrustum (theEnt) ? sensitivity (theEnt) : 1;
|
||||
const gp_Trsf aTrsfMtr = theEnt->HasInitLocation() ? theEnt->InvInitLocation() * theInvTrsf : theInvTrsf;
|
||||
const gp_GTrsf aTrsfMtr = theEnt->HasInitLocation() ? theEnt->InvInitLocation() * theInvTrsf : theInvTrsf;
|
||||
const Standard_Boolean toScale = aScale != 1;
|
||||
const Standard_Boolean toTransform = aTrsfMtr.Form() != gp_Identity;
|
||||
if (toScale && toTransform)
|
||||
@@ -309,7 +310,7 @@ void SelectMgr_ViewerSelector::traverseObject (const Handle(SelectMgr_Selectable
|
||||
|
||||
const NCollection_Handle<BVH_Tree<Standard_Real, 3> >& aSensitivesTree = anEntitySet->BVH();
|
||||
|
||||
gp_Trsf aInversedTrsf;
|
||||
gp_GTrsf aInversedTrsf;
|
||||
|
||||
if (theObject->HasTransformation() || theObject->TransformPersistence().Flags)
|
||||
{
|
||||
@@ -321,14 +322,24 @@ void SelectMgr_ViewerSelector::traverseObject (const Handle(SelectMgr_Selectable
|
||||
{
|
||||
const Graphic3d_Mat4d& aProjection = mySelectingVolumeMgr.ProjectionMatrix();
|
||||
const Graphic3d_Mat4d& aWorldView = mySelectingVolumeMgr.WorldViewMatrix();
|
||||
Standard_Integer aViewportWidth;
|
||||
Standard_Integer aViewportHeight;
|
||||
mySelectingVolumeMgr.WindowSize (aViewportWidth, aViewportHeight);
|
||||
|
||||
gp_Trsf aTPers;
|
||||
Graphic3d_Mat4d aMat = theObject->TransformPersistence().Compute (aProjection, aWorldView, 0, 0);
|
||||
aTPers.SetValues (aMat.GetValue (0, 0), aMat.GetValue (0, 1), aMat.GetValue (0, 2), aMat.GetValue (0, 3),
|
||||
aMat.GetValue (1, 0), aMat.GetValue (1, 1), aMat.GetValue (1, 2), aMat.GetValue (1, 3),
|
||||
aMat.GetValue (2, 0), aMat.GetValue (2, 1), aMat.GetValue (2, 2), aMat.GetValue (2, 3));
|
||||
gp_GTrsf aTPers;
|
||||
Graphic3d_Mat4d aMat = theObject->TransformPersistence().Compute (aProjection, aWorldView, aViewportWidth, aViewportHeight);
|
||||
aTPers.SetValue (1, 1, aMat.GetValue (0, 0));
|
||||
aTPers.SetValue (1, 2, aMat.GetValue (0, 1));
|
||||
aTPers.SetValue (1, 3, aMat.GetValue (0, 2));
|
||||
aTPers.SetValue (2, 1, aMat.GetValue (1, 0));
|
||||
aTPers.SetValue (2, 2, aMat.GetValue (1, 1));
|
||||
aTPers.SetValue (2, 3, aMat.GetValue (1, 2));
|
||||
aTPers.SetValue (3, 1, aMat.GetValue (2, 0));
|
||||
aTPers.SetValue (3, 2, aMat.GetValue (2, 1));
|
||||
aTPers.SetValue (3, 3, aMat.GetValue (2, 2));
|
||||
aTPers.SetTranslationPart (gp_XYZ (aMat.GetValue (0, 3), aMat.GetValue (1, 3), aMat.GetValue (2, 3)));
|
||||
|
||||
aInversedTrsf = (aTPers * theObject->Transformation()).Inverted();
|
||||
aInversedTrsf = (aTPers * gp_GTrsf (theObject->Transformation())).Inverted();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -429,7 +440,10 @@ void SelectMgr_ViewerSelector::TraverseSensitives()
|
||||
const Graphic3d_Mat4d& aProjection = mySelectingVolumeMgr.ProjectionMatrix();
|
||||
const Graphic3d_Mat4d& aWorldView = mySelectingVolumeMgr.WorldViewMatrix();
|
||||
const Graphic3d_WorldViewProjState& aWVPState = mySelectingVolumeMgr.WorldViewProjState();
|
||||
aBVHTree = mySelectableObjectsTrsfPers.BVH (aProjection, aWorldView, aWVPState);
|
||||
Standard_Integer aViewportWidth;
|
||||
Standard_Integer aViewportHeight;
|
||||
mySelectingVolumeMgr.WindowSize (aViewportWidth, aViewportHeight);
|
||||
aBVHTree = mySelectableObjectsTrsfPers.BVH (aProjection, aWorldView, aViewportWidth, aViewportHeight, aWVPState);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -842,9 +856,12 @@ void SelectMgr_ViewerSelector::RebuildObjectsTree (const Standard_Boolean theIsF
|
||||
const Graphic3d_Mat4d& aProjection = mySelectingVolumeMgr.ProjectionMatrix();
|
||||
const Graphic3d_Mat4d& aWorldView = mySelectingVolumeMgr.WorldViewMatrix();
|
||||
const Graphic3d_WorldViewProjState& aWVPState = mySelectingVolumeMgr.WorldViewProjState();
|
||||
Standard_Integer aViewportWidth;
|
||||
Standard_Integer aViewportHeight;
|
||||
mySelectingVolumeMgr.WindowSize (aViewportWidth, aViewportHeight);
|
||||
|
||||
mySelectableObjects.BVH();
|
||||
mySelectableObjectsTrsfPers.BVH (aProjection, aWorldView, aWVPState);
|
||||
mySelectableObjectsTrsfPers.BVH (aProjection, aWorldView, aViewportWidth, aViewportHeight, aWVPState);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -310,10 +310,11 @@ private:
|
||||
//! needs to be scaled and transformed for the entity and performs
|
||||
//! necessary calculations
|
||||
void computeFrustum (const Handle(SelectBasics_SensitiveEntity)& theEnt,
|
||||
const gp_Trsf& theInvTrsf,
|
||||
const gp_GTrsf& theInvTrsf,
|
||||
SelectMgr_FrustumCache& theCachedMgrs,
|
||||
SelectMgr_SelectingVolumeManager& theResMgr);
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
Standard_Boolean preferclosest;
|
||||
|
@@ -4449,16 +4449,27 @@ static Standard_Integer VState (Draw_Interpretor& theDI,
|
||||
const Handle(SelectBasics_SensitiveEntity)& anEntity = aSelector->DetectedEntity();
|
||||
Handle(SelectMgr_EntityOwner) anOwner = Handle(SelectMgr_EntityOwner)::DownCast (anEntity->OwnerId());
|
||||
Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast (anOwner->Selectable());
|
||||
gp_Trsf anInvTrsf;
|
||||
gp_GTrsf anInvTrsf;
|
||||
if (anObj->TransformPersistence().Flags)
|
||||
{
|
||||
const Graphic3d_Mat4d& aProjection = aMgr.ProjectionMatrix();
|
||||
const Graphic3d_Mat4d& aWorldView = aMgr.WorldViewMatrix();
|
||||
Standard_Integer aViewportWidth = 0;
|
||||
Standard_Integer aViewportHeight = 0;
|
||||
aMgr.WindowSize (aViewportWidth, aViewportHeight);
|
||||
|
||||
Graphic3d_Mat4d aMat = anObj->TransformPersistence().Compute (aProjection, aWorldView, 0, 0);
|
||||
anInvTrsf.SetValues (aMat.GetValue (0, 0), aMat.GetValue (0, 1), aMat.GetValue (0, 2), aMat.GetValue (0, 3),
|
||||
aMat.GetValue (1, 0), aMat.GetValue (1, 1), aMat.GetValue (1, 2), aMat.GetValue (1, 3),
|
||||
aMat.GetValue (2, 0), aMat.GetValue (2, 1), aMat.GetValue (2, 2), aMat.GetValue (2, 3));
|
||||
Graphic3d_Mat4d aMat = anObj->TransformPersistence().Compute (aProjection, aWorldView, aViewportWidth, aViewportHeight);
|
||||
|
||||
anInvTrsf.SetValue (1, 1, aMat.GetValue (0, 0));
|
||||
anInvTrsf.SetValue (1, 2, aMat.GetValue (0, 1));
|
||||
anInvTrsf.SetValue (1, 3, aMat.GetValue (0, 2));
|
||||
anInvTrsf.SetValue (2, 1, aMat.GetValue (1, 0));
|
||||
anInvTrsf.SetValue (2, 2, aMat.GetValue (1, 1));
|
||||
anInvTrsf.SetValue (2, 3, aMat.GetValue (1, 2));
|
||||
anInvTrsf.SetValue (3, 1, aMat.GetValue (2, 0));
|
||||
anInvTrsf.SetValue (3, 2, aMat.GetValue (2, 1));
|
||||
anInvTrsf.SetValue (3, 3, aMat.GetValue (2, 2));
|
||||
anInvTrsf.SetTranslationPart (gp_XYZ(aMat.GetValue (0, 3), aMat.GetValue (1, 3), aMat.GetValue (2, 3)));
|
||||
anInvTrsf.Invert();
|
||||
}
|
||||
if (anObj->HasTransformation())
|
||||
@@ -4477,8 +4488,13 @@ static Standard_Integer VState (Draw_Interpretor& theDI,
|
||||
: aMgr;
|
||||
SelectBasics_PickResult aResult;
|
||||
anEntity->Matches (anEntMgr, aResult);
|
||||
gp_Pnt aDetectedPnt = anInvTrsf.Form() == gp_Identity ?
|
||||
anEntMgr.DetectedPoint (aResult.Depth()) : anEntMgr.DetectedPoint (aResult.Depth()).Transformed (anInvTrsf.Inverted());
|
||||
|
||||
gp_Pnt aDetectedPnt = anEntMgr.DetectedPoint (aResult.Depth());
|
||||
|
||||
if (anInvTrsf.Form() != gp_Identity)
|
||||
{
|
||||
anInvTrsf.Inverted().Transforms (aDetectedPnt.ChangeCoord());
|
||||
}
|
||||
|
||||
TCollection_AsciiString aName = GetMapOfAIS().Find1 (anObj);
|
||||
aName.LeftJustify (20, ' ');
|
||||
|
@@ -10,7 +10,7 @@ set anImage1 $imagedir/${casename}_1.png
|
||||
set anImage2 $imagedir/${casename}_2.png
|
||||
vinit
|
||||
box b1 -1 -1 -1 3 3 3
|
||||
box b2 4 4 4 30 20 20
|
||||
box b2 4 4 4 15 10 10
|
||||
vdisplay b1
|
||||
vdisplay b2 -trsfPers zoom -trsfPersPos 0 0 0
|
||||
vfit
|
||||
|
@@ -11,8 +11,8 @@ vinit View1 w=409 h=409
|
||||
vtrihedron tri
|
||||
vpan 50 50
|
||||
|
||||
box b1 50 50 50
|
||||
box b2 50 50 50
|
||||
box b1 25 25 25
|
||||
box b2 25 25 25
|
||||
box b3 100 100 100
|
||||
box b4 100 100 100
|
||||
box b5 100 100 100
|
||||
@@ -22,7 +22,7 @@ vpoint p1 200 200 200
|
||||
|
||||
vdisplay b1 -trsfPers zoom -trsfPersPos 200 200 200
|
||||
vdisplay b2 -trsfPers zoom -trsfPersPos 200 200 200
|
||||
vsetlocation b2 -50 -50 -50
|
||||
vsetlocation b2 -25 -25 -25
|
||||
|
||||
vmoveto 384 78
|
||||
if { ![checkcolor 384 78 0 1 1] } {
|
||||
|
@@ -14,7 +14,7 @@ vsetdispmode 1
|
||||
|
||||
restore [locate_data_file face1.brep] f
|
||||
vdisplay f
|
||||
box b1 50 50 50
|
||||
box b1 25 25 25
|
||||
vdisplay b1 -trsfPers zoom -trsfPersPos 0 0 0
|
||||
|
||||
vviewparams -scale 588.7 -proj 0.69 -0.64 -0.38
|
||||
@@ -25,7 +25,7 @@ vviewparams -eye 0.7 -1.14 -0.17
|
||||
# with dynamic highlight color, check that the face is
|
||||
# not highlighted
|
||||
vmoveto 280 290
|
||||
if {[vreadpixel 290 297 name] != "CYAN1 1"} {
|
||||
if {[vreadpixel 297 297 name] != "CYAN1 1"} {
|
||||
puts "ERROR: zoom persistent box is not highlighted dynamically!"
|
||||
}
|
||||
if {[vreadpixel 372 210 name] != "GOLDENROD1 1"} {
|
||||
@@ -45,7 +45,8 @@ vviewparams -eye 0.96 1.053 0.31
|
||||
# move to a point on the box and check if it
|
||||
# will be highlighted dynamically
|
||||
vmoveto 264 135
|
||||
if {[vreadpixel 276 142 name] != "CYAN1 1"} {
|
||||
|
||||
if {[vreadpixel 275 142 name] != "CYAN1 1"} {
|
||||
puts "ERROR: zoom persistent box is not highlighted dynamically in precision test!"
|
||||
}
|
||||
if {[vreadpixel 243 123 name] != "LIGHTGOLDENROD1 1"} {
|
||||
@@ -56,8 +57,8 @@ vmoveto 0 0
|
||||
|
||||
# move to a point on the face and check if it
|
||||
# will be highlighted dynamically
|
||||
vmoveto 263 135
|
||||
if {[vreadpixel 276 142 name] != "GOLDENROD2 1"} {
|
||||
vmoveto 259 135
|
||||
if {[vreadpixel 275 142 name] != "GOLDENROD3 1"} {
|
||||
puts "ERROR: zoom persistent box is highlighted instead in precision test!"
|
||||
}
|
||||
if {[vreadpixel 243 123 name] != "CYAN1 1"} {
|
||||
|
@@ -37,15 +37,15 @@ vinit
|
||||
vtrihedron tri
|
||||
vpan 50 50
|
||||
|
||||
box b1 50 50 50
|
||||
box b2 50 50 50
|
||||
box b1 20.3 20.3 20.3
|
||||
box b2 20.3 20.3 20.3
|
||||
box b3 150 150 150 100 100 100
|
||||
|
||||
vpoint p1 200 200 200
|
||||
|
||||
vdisplay b1 -trsfPers zoom -trsfPersPos 200 200 200
|
||||
vdisplay b2 -trsfPers zoom -trsfPersPos 200 200 200
|
||||
vsetlocation b2 -50 -50 -50
|
||||
vsetlocation b2 -20.3 -20.3 -20.3
|
||||
vdisplay b3
|
||||
|
||||
vsetdispmode 1
|
||||
|
@@ -8,14 +8,14 @@ vinit
|
||||
vclear
|
||||
vaxo
|
||||
|
||||
box b 100 100 100
|
||||
box b 50 50 50
|
||||
vdisplay b -trsfPers zoom
|
||||
vzoom 0.01
|
||||
vzfit
|
||||
|
||||
checkcolor 204 184 1.0 1.0 0.0
|
||||
checkcolor 232 205 1.0 1.0 0.0
|
||||
checkcolor 262 182 1.0 1.0 0.0
|
||||
checkcolor 233 184 1.0 1.0 0.0
|
||||
checkcolor 238 205 1.0 1.0 0.0
|
||||
checkcolor 275 182 1.0 1.0 0.0
|
||||
checkcolor 239 184 1.0 1.0 0.0
|
||||
|
||||
checkview -screenshot -3d -path ${imagedir}/${test_image}.png
|
||||
|
30
tests/bugs/vis/bug27536
Normal file
30
tests/bugs/vis/bug27536
Normal file
@@ -0,0 +1,30 @@
|
||||
puts "========"
|
||||
puts "OCC27536"
|
||||
puts "========"
|
||||
puts ""
|
||||
##################################################################
|
||||
puts "Visualization - incorrect behavior of zoom persisted objects"
|
||||
##################################################################
|
||||
|
||||
set anImage1 $imagedir/${casename}_1.png
|
||||
set anImage2 $imagedir/${casename}_2.png
|
||||
|
||||
vinit
|
||||
vclear
|
||||
vaxo
|
||||
|
||||
box b -50 -50 -50 100 100 100
|
||||
vdisplay b -trsfPers zoom -trsfPersPos 0 0 0 -dispmode 1
|
||||
|
||||
vdump $anImage1
|
||||
|
||||
vinit View2 w=200 h=400
|
||||
vaxo
|
||||
vfit
|
||||
|
||||
# Check that box was't resized in small view
|
||||
if {[vreadpixel 165 200 name] != "DARKGOLDENROD3 1"} {
|
||||
puts "ERROR: zoom persistent box is resized on view sizes changed!"
|
||||
}
|
||||
|
||||
vdump $anImage2
|
Reference in New Issue
Block a user