1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-05-21 10:55:33 +03:00

0024413: Visualization - get rid of projection shift from orthographic camera definition

From now on, the panning behavior of V3d_View completely corresponds to equal operations with camera. There is no more confusing "Center" property and "ProjectionShift" which were used to introduce composite panning, while respecting view referential points: At, Eye unchanged. The V3d_View::FitAll approach has been rewritten to do "fit all" geometrically, operating with frustum, to make it working for both orthographic and perspective projections.

1) Getting rid of ProjectionShift and Center property:
- Removed ProjectionShift property of Graphic3d_Camera.
- Removed confusing Center property of V3d_View (related to projection shift).
- Removed redundant code related to the Center property of V3d_View.
- Removed WindowLimit method of Graphic3d_Camera - no more used.

2) Improvements of fit all and selector:
- Improved FitAll operation of V3d_View and reused it in NIS_View - the perspective projection is now handled correctly.
- Revised code of Select3D_Projector class - can be defined with any given projection and model-view matrices.
- Modified StdSelect_ViewerSelector3d and ensured that panning, zooming and going into the view do not lead to unwanted re-projection of sensitives. The handling of perspective selection is revised.
- Take into account graphical boundaries of infinite structure on ZFitAll.

3) Improvements of camera:
- Introduced new z range scale parameter for V3d_View::AutoZFit. See, V3d_View::AutoZFitMode.
- Allow negative ZNear, ZFar for orthographic camera to avoid clipping of viewed model.
- Moved camera ZNear, ZFar validity checks to V3d_View level.
- Use more meaningful Standard_ShortReal relative precision for ZNear, ZFar ranges computed by ZFitAll.
- Use Standard_Real type for camera projection and orientation matrices.
- Extended camera to generate both Standard_Real and Standard_ShortReal transformation matrices using the same matrix evaluation methods and converted input parameters.

Correcting picking tests for perspective view

Modify v3d face test cases for 1px changes in face picking

Modified test cases for new arguments of vviewparams DRAWEXE command
This commit is contained in:
apl 2014-03-06 15:15:53 +04:00 committed by abv
parent e618b52683
commit 197ac94e72
780 changed files with 5417 additions and 4305 deletions

View File

@ -61,6 +61,7 @@ Graphic3d_Vec2.hxx
Graphic3d_Vec3.hxx
Graphic3d_Vec4.hxx
Graphic3d_Mat4.hxx
Graphic3d_Mat4d.hxx
Graphic3d_Vertex.hxx
Graphic3d_Vertex.cxx
Graphic3d_MarkerImage.hxx

View File

@ -417,8 +417,8 @@ is
primitive Vec2;
primitive Vec3;
primitive Vec4;
primitive Mat4;
primitive Mat4d;
imported Mat4;
imported Mat4d;
--------------------
-- Category: Classes

File diff suppressed because it is too large Load Diff

View File

@ -16,9 +16,12 @@
#ifndef _Graphic3d_Camera_HeaderFile
#define _Graphic3d_Camera_HeaderFile
#include <Graphic3d_Mat4d.hxx>
#include <Graphic3d_Mat4.hxx>
#include <Graphic3d_Vec3.hxx>
#include <NCollection_Handle.hxx>
#include <gp_Dir.hxx>
#include <gp_Pnt.hxx>
@ -31,6 +34,53 @@ DEFINE_STANDARD_HANDLE (Graphic3d_Camera, Standard_Transient)
//! and orientation properties of 3D view.
class Graphic3d_Camera : public Standard_Transient
{
private:
//! Template container for cached matrices or Real/ShortReal types.
template<typename Elem_t>
struct TransformMatrices
{
void InitOrientation()
{
Orientation = new NCollection_Mat4<Elem_t>();
}
void InitProjection()
{
MProjection = new NCollection_Mat4<Elem_t>();
LProjection = new NCollection_Mat4<Elem_t>();
RProjection = new NCollection_Mat4<Elem_t>();
}
void ResetOrientation()
{
Orientation.Nullify();
}
void ResetProjection()
{
MProjection.Nullify();
LProjection.Nullify();
RProjection.Nullify();
}
Standard_Boolean IsOrientationValid()
{
return !Orientation.IsNull();
}
Standard_Boolean IsProjectionValid()
{
return !MProjection.IsNull() &&
!LProjection.IsNull() &&
!RProjection.IsNull();
}
NCollection_Handle< NCollection_Mat4<Elem_t> > Orientation;
NCollection_Handle< NCollection_Mat4<Elem_t> > MProjection;
NCollection_Handle< NCollection_Mat4<Elem_t> > LProjection;
NCollection_Handle< NCollection_Mat4<Elem_t> > RProjection;
};
public:
@ -75,7 +125,7 @@ public:
//! Initializes camera with the following properties:
//! Eye (0, 0, -2); Center (0, 0, 0); Up (0, 1, 0);
//! Type (Orthographic); FOVy (45); Scale (1000); IsStereo(false);
//! ZNear (0.1); ZFar (100); Aspect(1);
//! ZNear (0.001); ZFar (3000.0); Aspect(1);
//! ZFocus(1.0); ZFocusType(Relative); IOD(0.05); IODType(Relative)
Standard_EXPORT Graphic3d_Camera();
@ -93,17 +143,8 @@ public:
//! @param theOther [in] the camera to copy from.
Standard_EXPORT void Copy (const Handle(Graphic3d_Camera)& theOther);
//! Returns modification state of camera projection matrix
Standard_Size ProjectionState() const
{
return myProjectionState;
}
//! Returns modification state of camera model-view matrix
Standard_Size ModelViewState() const
{
return myOrientationState;
}
//! @name Public camera properties
public:
//! Sets camera Eye position.
//! @param theEye [in] the location of camera's Eye.
@ -127,10 +168,16 @@ public:
return myCenter;
}
//! Sets camera Up direction vector.
//! Sets camera Up direction vector, orthogonal to camera direction.
//! @param theUp [in] the Up direction vector.
Standard_EXPORT void SetUp (const gp_Dir& theUp);
//! Orthogonalize up direction vector.
Standard_EXPORT void OrthogonalizeUp();
//! Return a copy of orthogonalized up direction vector.
Standard_EXPORT gp_Dir OrthogonalizedUp() const;
//! Get camera Up direction vector.
//! @return Camera's Up direction vector.
const gp_Dir& Up() const
@ -138,26 +185,13 @@ public:
return myUp;
}
//! Set camera projection shift vector.<br>
//! Used for compatibility with older view mechanics. Applied after
//! view transform and before projection step (P * Shift * V).
//! @param theProjShift [in] the projection shift vector.
Standard_EXPORT void SetProjectionShift (const gp_Pnt& theProjShift);
//! Get camera projection shift vector.
//! @return Camera's projection shift vector.
const gp_Pnt& ProjectionShift() const
{
return myProjectionShift;
}
//! Set camera axial scale.<br>
//! @param theAxialScale [in] the axial scale vector.
Standard_EXPORT void SetAxialScale (const gp_Pnt& theAxialScale);
Standard_EXPORT void SetAxialScale (const gp_XYZ& theAxialScale);
//! Get camera axial scale.
//! @return Camera's axial scale.
const gp_Pnt& AxialScale() const
const gp_XYZ& AxialScale() const
{
return myAxialScale;
}
@ -190,9 +224,9 @@ public:
Standard_EXPORT Standard_Real Scale() const;
//! Change camera projection type.
//! While switching between perspective and ortho projection types
//! ZNear and ZFar value conversion is performed due to different
//! coordinate systems (made for compatibility, to be improved..)
//! When switching to perspective projection from orthographic one,
//! the ZNear and ZFar are reset to default values (0.001, 3000.0)
//! if less than 0.0.
//! @param theProjectionType [in] the camera projection type.
Standard_EXPORT void SetProjectionType (const Projection theProjection);
@ -231,9 +265,14 @@ public:
return myFOVy;
}
//! Change the Near Z-clipping plane position.
//! Change the Near and Far Z-clipping plane positions.
//! For orthographic projection, theZNear, theZFar can be negative or positive.
//! For perspective projection, only positive values are allowed.
//! Program error exception is raised if non-positive values are
//! specified for perspective projection or theZNear >= theZFar.
//! @param theZNear [in] the distance of the plane from the Eye.
Standard_EXPORT void SetZNear (const Standard_Real theZNear);
//! @param theZFar [in] the distance of the plane from the Eye.
Standard_EXPORT void SetZRange (const Standard_Real theZNear, const Standard_Real theZFar);
//! Get the Near Z-clipping plane position.
//! @return the distance of the plane from the Eye.
@ -242,10 +281,6 @@ public:
return myZNear;
}
//! Change the Far Z-clipping plane position.
//! @param theZFar [in] the distance of the plane from the Eye.
Standard_EXPORT void SetZFar (const Standard_Real theZFar);
//! Get the Far Z-clipping plane position.
//! @return the distance of the plane from the Eye.
Standard_Real ZFar() const
@ -307,52 +342,7 @@ public:
return myIODType;
}
//! Get orientation matrix.
//! @return camera orientation matrix.
const Graphic3d_Mat4& OrientationMatrix() const
{
return myOrientation;
}
//! Get monographic or middle point projection matrix used for monographic
//! rendering and for point projection / unprojection.
//! @return monographic projection matrix.
const Graphic3d_Mat4& ProjectionMatrix() const
{
return myMProjection;
}
//! @return stereographic matrix computed for left eye. Please note
//! that this method is used for rendering for <i>Projection_Stereo</i>.
const Graphic3d_Mat4& ProjectionStereoLeft() const
{
return myLProjection;
}
//! @return stereographic matrix computed for right eye. Please note
//! that this method is used for rendering for <i>Projection_Stereo</i>.
const Graphic3d_Mat4& ProjectionStereoRight() const
{
return myRProjection;
}
public:
//! Orthogonalize up direction vector.
Standard_EXPORT void OrthogonalizeUp();
//! Suspend internal data recalculation when changing set of camera
//! properties. This method is optional and can be used for pieces
//! of code which are critical to performance. Note that the method
//! supports stacked calls (carried out by internal counter).
Standard_EXPORT void BeginUpdate();
//! Unset lock set by <i>BeginUpdate</i> and invoke data recalculation when
//! there are no more locks left. This method is optional and can be used
//! for pieces of code which are critical to performance.
Standard_EXPORT void EndUpdate();
// Basic camera operations
//! @name Basic camera operations
public:
//! Transform orientation components of the camera:
@ -363,20 +353,28 @@ public:
//! Calculate view plane size at center (target) point
//! and distance between ZFar and ZNear planes.
//! @return values in form of gp_Pnt (Width, Height, Depth).
Standard_EXPORT gp_Pnt ViewDimensions () const;
Standard_EXPORT gp_XYZ ViewDimensions() const;
//! Calculate view plane dimensions with projection shift applied.
//! Analog to old ViewMapping.WindowLimit() function.
//! @param theUMin [out] the u component of min corner of the rect.
//! @param theVMin [out] the v component of min corner of the rect.
//! @param theUMax [out] the u component of max corner of the rect.
//! @param theVMax [out] the v component of max corner of the rect.
Standard_EXPORT void WindowLimit (Standard_Real& theUMin,
Standard_Real& theVMin,
Standard_Real& theUMax,
Standard_Real& theVMax) const;
//! Calculate WCS frustum planes for the camera projection volume.
//! Frustum is a convex volume determined by six planes directing
//! inwards.
//! The frustum planes are usually used as inputs for camera algorithms.
//! Thus, if any changes to projection matrix calculation are necessary,
//! the frustum planes calculation should be also touched.
//! @param theLeft [out] the frustum plane for left side of view.
//! @param theRight [out] the frustum plane for right side of view.
//! @param theBottom [out] the frustum plane for bottom side of view.
//! @param theTop [out] the frustum plane for top side of view.
//! @param theNear [out] the frustum plane for near side of view.
//! @param theFar [out] the frustum plane for far side of view.
Standard_EXPORT void Frustum (gp_Pln& theLeft,
gp_Pln& theRight,
gp_Pln& theBottom,
gp_Pln& theTop,
gp_Pln& theNear,
gp_Pln& theFar) const;
// Projection methods
//! @name Projection methods
public:
//! Project point from world coordinate space to
@ -415,14 +413,80 @@ public:
//! @return point in WCS.
Standard_EXPORT gp_Pnt ConvertView2World (const gp_Pnt& thePnt) const;
// managing projection and orientation cache:
//! @name Camera modification state
public:
//! Compute and cache projection matrices.
void UpdateProjection();
//! Returns modification state of camera projection matrix
Standard_Size ProjectionState() const
{
return myProjectionState;
}
//! Compute and cache orientation matrix.
void UpdateOrientation();
//! Returns modification state of camera model-view matrix
Standard_Size ModelViewState() const
{
return myOrientationState;
}
//! @name Lazily-computed orientation and projection matrices derived from camera parameters
public:
//! Get orientation matrix.
//! @return camera orientation matrix.
Standard_EXPORT const Graphic3d_Mat4d& OrientationMatrix() const;
//! Get orientation matrix of Standard_ShortReal precision.
//! @return camera orientation matrix.
Standard_EXPORT const Graphic3d_Mat4& OrientationMatrixF() const;
//! Get monographic or middle point projection matrix used for monographic
//! rendering and for point projection / unprojection.
//! @return monographic projection matrix.
Standard_EXPORT const Graphic3d_Mat4d& ProjectionMatrix() const;
//! Get monographic or middle point projection matrix of Standard_ShortReal precision used for monographic
//! rendering and for point projection / unprojection.
//! @return monographic projection matrix.
Standard_EXPORT const Graphic3d_Mat4& ProjectionMatrixF() const;
//! @return stereographic matrix computed for left eye. Please note
//! that this method is used for rendering for <i>Projection_Stereo</i>.
Standard_EXPORT const Graphic3d_Mat4d& ProjectionStereoLeft() const;
//! @return stereographic matrix of Standard_ShortReal precision computed for left eye.
//! Please note that this method is used for rendering for <i>Projection_Stereo</i>.
Standard_EXPORT const Graphic3d_Mat4& ProjectionStereoLeftF() const;
//! @return stereographic matrix computed for right eye. Please note
//! that this method is used for rendering for <i>Projection_Stereo</i>.
Standard_EXPORT const Graphic3d_Mat4d& ProjectionStereoRight() const;
//! @return stereographic matrix of Standard_ShortReal precision computed for right eye.
//! Please note that this method is used for rendering for <i>Projection_Stereo</i>.
Standard_EXPORT const Graphic3d_Mat4& ProjectionStereoRightF() const;
//! @name Managing projection and orientation cache
private:
//! Compute projection matrices.
//! @param theMatrices [in] the matrices data container.
template <typename Elem_t>
Standard_EXPORT
TransformMatrices<Elem_t>& UpdateProjection (TransformMatrices<Elem_t>& theMatrices) const;
//! Compute orientation matrix.
//! @param theMatrices [in] the matrices data container.
template <typename Elem_t>
Standard_EXPORT
TransformMatrices<Elem_t>& UpdateOrientation (TransformMatrices<Elem_t>& theMatrices) const;
//! Invalidate state of projection matrix.
//! The matrix will be updated on request.
void InvalidateProjection();
//! Invalidate orientation matrix.
//! The matrix will be updated on request.
void InvalidateOrientation();
private:
@ -434,19 +498,16 @@ private:
//! @param theTop [in] the top mapping (clipping) coordinate.
//! @param theNear [in] the near mapping (clipping) coordinate.
//! @param theFar [in] the far mapping (clipping) coordinate.
//! @param theShiftX [in] the shift x coordinate.
//! @param theShiftY [in] the shift y coordinate.
//! @param theOutMx [out] the projection matrix.
template <typename Elem_t>
static void
OrthoProj (const Standard_ShortReal theLeft,
const Standard_ShortReal theRight,
const Standard_ShortReal theBottom,
const Standard_ShortReal theTop,
const Standard_ShortReal theNear,
const Standard_ShortReal theFar,
const Standard_ShortReal theShiftX,
const Standard_ShortReal theShiftY,
Graphic3d_Mat4& theOutMx);
OrthoProj (const Elem_t theLeft,
const Elem_t theRight,
const Elem_t theBottom,
const Elem_t theTop,
const Elem_t theNear,
const Elem_t theFar,
NCollection_Mat4<Elem_t>& theOutMx);
//! Compose perspective projection matrix for
//! the passed camera volume mapping.
@ -456,19 +517,16 @@ private:
//! @param theTop [in] the top mapping (clipping) coordinate.
//! @param theNear [in] the near mapping (clipping) coordinate.
//! @param theFar [in] the far mapping (clipping) coordinate.
//! @param theShiftX [in] the shift x coordinate.
//! @param theShiftY [in] the shift y coordinate.
//! @param theOutMx [out] the projection matrix.
template <typename Elem_t>
static void
PerspectiveProj (const Standard_ShortReal theLeft,
const Standard_ShortReal theRight,
const Standard_ShortReal theBottom,
const Standard_ShortReal theTop,
const Standard_ShortReal theNear,
const Standard_ShortReal theFar,
const Standard_ShortReal theShiftX,
const Standard_ShortReal theShiftY,
Graphic3d_Mat4& theOutMx);
PerspectiveProj (const Elem_t theLeft,
const Elem_t theRight,
const Elem_t theBottom,
const Elem_t theTop,
const Elem_t theNear,
const Elem_t theFar,
NCollection_Mat4<Elem_t>& theOutMx);
//! Compose projection matrix for L/R stereo eyes.
//! @param theLeft [in] the left mapping (clipping) coordinate.
@ -480,23 +538,20 @@ private:
//! @param theIOD [in] the Intraocular distance.
//! @param theZFocus [in] the z coordinate of off-axis
//! projection plane with zero parallax.
//! @param theShiftX [in] the shift x coordinate.
//! @param theShiftY [in] the shift y coordinate.
//! @param theIsLeft [in] boolean flag to choose between L/R eyes.
//! @param theOutMx [out] the projection matrix.
template <typename Elem_t>
static void
StereoEyeProj (const Standard_ShortReal theLeft,
const Standard_ShortReal theRight,
const Standard_ShortReal theBottom,
const Standard_ShortReal theTop,
const Standard_ShortReal theNear,
const Standard_ShortReal theFar,
const Standard_ShortReal theIOD,
const Standard_ShortReal theZFocus,
const Standard_ShortReal theShiftX,
const Standard_ShortReal theShiftY,
StereoEyeProj (const Elem_t theLeft,
const Elem_t theRight,
const Elem_t theBottom,
const Elem_t theTop,
const Elem_t theNear,
const Elem_t theFar,
const Elem_t theIOD,
const Elem_t theZFocus,
const Standard_Boolean theIsLeft,
Graphic3d_Mat4& theOutMx);
NCollection_Mat4<Elem_t>& theOutMx);
//! Construct "look at" orientation transformation.
//! Reference point differs for perspective and ortho modes
@ -506,12 +561,13 @@ private:
//! @param theUpDir [in] the up direction vector.
//! @param theAxialScale [in] the axial scale vector.
//! @param theOutMx [in/out] the orientation matrix.
template <typename Elem_t>
static void
LookOrientation (const Graphic3d_Vec3& theEye,
const Graphic3d_Vec3& theLookAt,
Graphic3d_Vec3& theUpDir,
const Graphic3d_Vec3& theAxialScale,
Graphic3d_Mat4& theOutMx);
LookOrientation (const NCollection_Vec3<Elem_t>& theEye,
const NCollection_Vec3<Elem_t>& theLookAt,
const NCollection_Vec3<Elem_t>& theUpDir,
const NCollection_Vec3<Elem_t>& theAxialScale,
NCollection_Mat4<Elem_t>& theOutMx);
private:
@ -519,8 +575,7 @@ private:
gp_Pnt myEye; //!< Camera eye position.
gp_Pnt myCenter; //!< Camera center.
gp_Pnt myProjectionShift; //!< Camera projection shift for compatibility.
gp_Pnt myAxialScale; //!< Camera axial scale.
gp_XYZ myAxialScale; //!< World axial scale.
Projection myProjType; //!< Projection type used for rendering.
Standard_Real myFOVy; //!< Field Of View in y axis.
@ -535,19 +590,11 @@ private:
Standard_Real myIOD; //!< Intraocular distance value.
IODType myIODType; //!< Intraocular distance definition type.
//! Number of locks set up on internal data recalculation by
//! <i>(BeginUpdate, EndUpdate)</i> pairs. The counter provides effective
//! use of the mentioned methods when camera properties are modified
//! in stacked functions.
Standard_Integer myNbUpdateLocks;
mutable TransformMatrices<Standard_Real> myMatricesD;
mutable TransformMatrices<Standard_ShortReal> myMatricesF;
Graphic3d_Mat4 myOrientation; //!< Camera orientation matrix.
Graphic3d_Mat4 myMProjection; //!< Monographic projection matrix.
Graphic3d_Mat4 myLProjection; //!< Projection matrix for left eye.
Graphic3d_Mat4 myRProjection; //!< Projection matrix for right eye.
Standard_Size myProjectionState;
Standard_Size myOrientationState;
mutable Standard_Size myProjectionState;
mutable Standard_Size myOrientationState;
public:

View File

@ -18,6 +18,5 @@
#include <Standard_TypeDef.hxx>
typedef NCollection_Mat4<Standard_ShortReal> Graphic3d_Mat4;
typedef NCollection_Mat4<Standard_Real> Graphic3d_Mat4d;
#endif // _Graphic3d_Mat4_HeaderFile

View File

@ -0,0 +1,22 @@
// Copyright (c) 2013 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and / or modify it
// under the terms of the GNU Lesser General Public version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _Graphic3d_Mat4d_HeaderFile
#define _Graphic3d_Mat4d_HeaderFile
#include <NCollection_Mat4.hxx>
#include <Standard_TypeDef.hxx>
typedef NCollection_Mat4<Standard_Real> Graphic3d_Mat4d;
#endif // _Graphic3d_Mat4d_HeaderFile

View File

@ -214,16 +214,12 @@ is
-- with the highlight method TOHM_COLOR or TOHM_BOUNDBOX.
---Category: Methods to modify the class definition
SetInfiniteState ( me : mutable;
AFlag : Boolean from Standard )
is static;
SetInfiniteState (me : mutable; theToSet : Boolean from Standard) is static;
---Level: Internal
---Purpose: Modifies the coordinates of the boundary box
-- of the structure <me>.
-- if <AFlag> is Standard_True then <me> is infinite and
-- the MinMaxValues method or the MinMaxCoord method return :
-- XMin = YMin = ZMin = RealFirst ().
-- XMax = YMax = ZMax = RealLast ().
---Purpose: If <theToSet> is Standard_True then <me> is infinite and
-- the MinMaxValues method method return :
-- theXMin = theYMin = theZMin = RealFirst().
-- theXMax = theYMax = theZMax = RealLast().
-- By default, <me> is not infinite but empty.
---Category: Methods to modify the class definition
@ -556,15 +552,21 @@ is
-- for 3d marker primitives.
MinMaxValues (me;
XMin, YMin, ZMin : out Real from Standard;
XMax, YMax, ZMax : out Real from Standard )
theXMin, theYMin, theZMin : out Real from Standard;
theXMax, theYMax, theZMax : out Real from Standard;
theToIgnoreInfiniteFlag : Boolean from Standard = Standard_False)
is static;
---Level: Public
---Purpose: Returns the coordinates of the boundary box
-- of the structure <me>.
---Purpose: Returns the coordinates of the boundary box of the structure <me>.
-- If <theToIgnoreInfiniteFlag> is TRUE, the method returns actual graphical
-- boundaries of the Graphic3d_Group components. Otherwise, the
-- method returns boundaries taking into account infinite state
-- of the structure. This approach generally used for application
-- specific fit operation (e.g. fitting the model into screen,
-- not taking into accout infinite helper elements).
-- Warning: If the structure <me> is empty or infinite then :
-- XMin = YMin = ZMin = RealFirst ().
-- XMax = YMax = ZMax = RealLast ().
-- theXMin = theYMin = theZMin = RealFirst ().
-- theXMax = theYMax = theZMax = RealLast ().
---Category: Inquire methods
PrimitivesAspect ( me;
@ -878,15 +880,26 @@ is
---Category: Private methods
MinMaxCoord (me;
XMin, YMin, ZMin : out Real from Standard;
XMax, YMax, ZMax : out Real from Standard )
theXMin, theYMin, theZMin : out Real from Standard;
theXMax, theYMax, theZMax : out Real from Standard)
is static private;
---Level: Internal
---Purpose: Returns the extreme coordinates found in the
-- structure <me>.
---Purpose: Returns the extreme coordinates found in the structure <me>.
-- Warning: If the structure <me> is empty or infinite then :
-- XMin = YMin = ZMin = RealFirst ().
-- XMax = YMax = ZMax = RealLast ().
-- theXMin = theYMin = theZMin = RealFirst().
-- theXMax = theYMax = theZMax = RealLast().
---Category: Private methods
MinMaxCoordWithDescendants (me;
theXMin, theYMin, theZMin : out Real from Standard;
theXMax, theYMax, theZMax : out Real from Standard)
is static private;
---Level: Internal
---Purpose: Returns the extreme coordinates found in the structure <me>
-- and its descendants with transformation applied.
-- Warning: If the structure <me> is empty or infinite then :
-- theXMin = theYMin = theZMin = RealFirst().
-- theXMax = theYMax = theZMax = RealLast().
---Category: Private methods
Plot ( me : mutable;
@ -957,6 +970,15 @@ is
---Purpose: Transforms <Coord> with the transformation <ATrsf>.
---Category: Private methods
TransformBoundaries (myclass;
theTrsf : Array2OfReal from TColStd;
theXMin, theYMin, theZMin : in out Real from Standard;
theXMax, theYMax, theZMax : in out Real from Standard)
is protected;
---Level: Internal
---Purpose: Transforms boundaries with <theTrsf> transformation.
---Category: Private methods
Update ( me )
is static private;
---Level: Internal

View File

@ -683,10 +683,13 @@ void Graphic3d_Structure::ReCompute (const Handle(Graphic3d_DataStructureManager
}
void Graphic3d_Structure::SetInfiniteState (const Standard_Boolean AValue) {
MyCStructure.IsInfinite = AValue ? 1:0;
//=============================================================================
//function : SetInfiniteState
//purpose :
//=============================================================================
void Graphic3d_Structure::SetInfiniteState (const Standard_Boolean theToSet)
{
MyCStructure.IsInfinite = theToSet ? 1 : 0;
}
Standard_Boolean Graphic3d_Structure::IsInfinite () const {
@ -1645,70 +1648,120 @@ void Graphic3d_Structure::Transform (TColStd_Array2OfReal& AMatrix) const {
}
void Graphic3d_Structure::MinMaxValues (Standard_Real& XMin, Standard_Real& YMin, Standard_Real& ZMin, Standard_Real& XMax, Standard_Real& YMax, Standard_Real& ZMax) const {
Standard_Real RL = RealLast ();
Standard_Real RF = RealFirst ();
Standard_Real XTMin, YTMin, ZTMin, XTMax, YTMax, ZTMax, U, V, W;
MinMaxCoord (XTMin, YTMin, ZTMin, XTMax, YTMax, ZTMax);
if ((XTMin == RF) && (YTMin == RF) &&
(ZTMin == RF) && (XTMax == RL) &&
(YTMax == RL) && (ZTMax == RL)) {
// Case impossible as it would mean that
// the structure is empty
XMin = RF;
YMin = RF;
ZMin = RF;
XMax = RL;
YMax = RL;
ZMax = RL;
//=============================================================================
//function : MinMaxValues
//purpose :
//=============================================================================
void Graphic3d_Structure::MinMaxValues (Standard_Real& theXMin,
Standard_Real& theYMin,
Standard_Real& theZMin,
Standard_Real& theXMax,
Standard_Real& theYMax,
Standard_Real& theZMax,
const Standard_Boolean theToIgnoreInfiniteFlag) const
{
if (IsEmpty())
{
return;
}
else {
Standard_Integer i, j;
TColStd_Array2OfReal TheTrsf (0, 3, 0, 3);
for (i=0; i<=3; i++)
for (j=0; j<=3; j++)
TheTrsf (i, j) = MyCStructure.Transformation[i][j];
Standard_Real aXMin, aYMin, aZMin, aXMax, aYMax, aZMax;
MinMaxCoord (aXMin, aYMin, aZMin, aXMax, aYMax, aZMax);
Graphic3d_Structure::Transforms
(TheTrsf, XTMin, YTMin, ZTMin, XMin, YMin, ZMin);
Graphic3d_Structure::Transforms
(TheTrsf, XTMax, YTMax, ZTMax, XMax, YMax, ZMax);
Graphic3d_Structure::Transforms
(TheTrsf, XTMin, YTMin, ZTMax, U, V, W);
XMin = Min(U,XMin) ; XMax = Max(U,XMax) ;
YMin = Min(V,YMin) ; YMax = Max(V,YMax) ;
ZMin = Min(W,ZMin) ; ZMax = Max(W,ZMax) ;
Graphic3d_Structure::Transforms
(TheTrsf, XTMax, YTMin, ZTMax, U, V, W);
XMin = Min(U,XMin) ; XMax = Max(U,XMax) ;
YMin = Min(V,YMin) ; YMax = Max(V,YMax) ;
ZMin = Min(W,ZMin) ; ZMax = Max(W,ZMax) ;
Graphic3d_Structure::Transforms
(TheTrsf, XTMax, YTMin, ZTMin, U, V, W);
XMin = Min(U,XMin) ; XMax = Max(U,XMax) ;
YMin = Min(V,YMin) ; YMax = Max(V,YMax) ;
ZMin = Min(W,ZMin) ; ZMax = Max(W,ZMax) ;
Graphic3d_Structure::Transforms
(TheTrsf, XTMax, YTMax, ZTMin, U, V, W);
XMin = Min(U,XMin) ; XMax = Max(U,XMax) ;
YMin = Min(V,YMin) ; YMax = Max(V,YMax) ;
ZMin = Min(W,ZMin) ; ZMax = Max(W,ZMax) ;
Graphic3d_Structure::Transforms
(TheTrsf, XTMin, YTMax, ZTMax, U, V, W);
XMin = Min(U,XMin) ; XMax = Max(U,XMax) ;
YMin = Min(V,YMin) ; YMax = Max(V,YMax) ;
ZMin = Min(W,ZMin) ; ZMax = Max(W,ZMax) ;
Graphic3d_Structure::Transforms
(TheTrsf, XTMin, YTMax, ZTMin, U, V, W);
XMin = Min(U,XMin) ; XMax = Max(U,XMax) ;
YMin = Min(V,YMin) ; YMax = Max(V,YMax) ;
ZMin = Min(W,ZMin) ; ZMax = Max(W,ZMax) ;
// Infinite boundaries corresponding to empty structure or
// non-empty structure, without any primitives specified
if (aXMin == RealFirst() && aYMin == RealFirst() && aZMin == RealFirst() &&
aXMax == RealLast() && aYMax == RealLast() && aZMax == RealLast())
{
theXMin = RealFirst();
theYMin = RealFirst();
theZMin = RealFirst();
theXMax = RealLast();
theYMax = RealLast();
theZMax = RealLast();
return;
}
// Handle flag, which specifies that structure should be considered as infinite
if (IsInfinite() && !theToIgnoreInfiniteFlag)
{
Graphic3d_Vertex aVertexMin (aXMin, aYMin, aZMin);
Graphic3d_Vertex aVertexMax (aXMax, aYMax, aZMax);
const Standard_Real aDistance = aVertexMin.Distance (aVertexMax);
// Special case for infinite line:
// Bounding borders of infinite line has been
// calculated as own point in center of this line
if (aDistance >= 500000.0)
{
theXMin = theXMax = 0.5 * (aXMin + aXMax);
theYMin = theYMax = 0.5 * (aYMin + aYMax);
theZMin = theZMax = 0.5 * (aZMin + aZMax);
return;
}
theXMin = RealFirst();
theYMin = RealFirst();
theZMin = RealFirst();
theXMax = RealLast();
theYMax = RealLast();
theZMax = RealLast();
return;
}
// Min-Max values of the descendant structures
Standard_Real aDescXMin = RealLast();
Standard_Real aDescYMin = RealLast();
Standard_Real aDescZMin = RealLast();
Standard_Real aDescXMax = RealFirst();
Standard_Real aDescYMax = RealFirst();
Standard_Real aDescZMax = RealFirst();
for (Standard_Integer aStructIt = 1; aStructIt <= MyDescendants.Length(); aStructIt++)
{
Graphic3d_Structure* aStructure = (Graphic3d_Structure*) MyDescendants.Value (aStructIt);
aStructure->MinMaxValues (aXMin, aYMin, aZMin, aXMax, aYMax, aZMax);
aDescXMin = Min (aXMin, aDescXMin);
aDescYMin = Min (aYMin, aDescYMin);
aDescZMin = Min (aZMin, aDescZMin);
aDescXMax = Max (aXMax, aDescXMax);
aDescYMax = Max (aYMax, aDescYMax);
aDescZMax = Max (aZMax, aDescZMax);
}
if (aDescXMin != RealLast() || aDescYMin != RealLast() ||
aDescZMin != RealLast() || aDescXMax != RealFirst() ||
aDescYMax != RealFirst() || aDescZMax != RealFirst())
{
aXMin = Min (aDescXMin, aXMin);
aYMin = Min (aDescYMin, aYMin);
aZMin = Min (aDescZMin, aZMin);
aXMax = Max (aDescXMax, aXMax);
aYMax = Max (aDescYMax, aYMax);
aZMax = Max (aDescZMax, aZMax);
}
// Case impossible as it would mean that the structure is empty or infinite
if (aXMin == RealFirst() && aYMin == RealFirst() && aZMin == RealFirst() &&
aXMax == RealLast() && aYMax == RealLast() && aZMax == RealLast())
{
theXMin = RealFirst();
theYMin = RealFirst();
theZMin = RealFirst();
theXMax = RealLast();
theYMax = RealLast();
theZMax = RealLast();
return;
}
TColStd_Array2OfReal aTrsf(0, 3, 0, 3);
Transform (aTrsf);
TransformBoundaries (aTrsf, aXMin, aYMin, aZMin, aXMax, aYMax, aZMax);
theXMin = aXMin;
theYMin = aYMin;
theZMin = aZMin;
theXMax = aXMax;
theYMax = aYMax;
theZMax = aZMax;
}
Standard_Integer Graphic3d_Structure::Identification () const {
@ -1825,93 +1878,156 @@ Handle(Graphic3d_StructureManager) Graphic3d_Structure::StructureManager () cons
}
void Graphic3d_Structure::MinMaxCoord (Standard_Real& XMin, Standard_Real& YMin, Standard_Real& ZMin, Standard_Real& XMax, Standard_Real& YMax, Standard_Real& ZMax) const {
Standard_Real RL = RealLast ();
Standard_Real RF = RealFirst ();
Standard_Real Xm, Ym, Zm, XM, YM, ZM;
//Bounding borders of infinite line has been calculated as own point
//in center of this line
if (IsEmpty () || IsInfinite ()) {
if( IsInfinite ()){
for (int i=1; i<=MyGroups.Length (); i++)
if (! (MyGroups.Value (i))->IsEmpty () ) {
(MyGroups.Value (i))->MinMaxValues(Xm, Ym, Zm, XM, YM, ZM);
Graphic3d_Vertex vertex1(Xm, Ym, Zm);
Graphic3d_Vertex vertex2(XM, YM, ZM);
const Standard_Real distance = vertex1.Distance( vertex2 );
if( distance >= 500000.0){
XMin = XMax = 0.5*(Xm+ XM);
YMin = YMax = 0.5*(Ym+ YM);
ZMin = ZMax = 0.5*(Zm+ ZM);
//=============================================================================
//function : MinMaxCoord
//purpose :
//=============================================================================
void Graphic3d_Structure::MinMaxCoord (Standard_Real& theXMin,
Standard_Real& theYMin,
Standard_Real& theZMin,
Standard_Real& theXMax,
Standard_Real& theYMax,
Standard_Real& theZMax) const
{
if (IsEmpty())
{
theXMin = RealFirst();
theYMin = RealFirst();
theZMin = RealFirst();
theXMax = RealLast();
theYMax = RealLast();
theZMax = RealLast();
return;
}
}
}
XMin = RF;
YMin = RF;
ZMin = RF;
XMax = RL;
YMax = RL;
ZMax = RL;
}
else {
XMin = RL;
YMin = RL;
ZMin = RL;
Standard_Real aXMin = RealLast();
Standard_Real aYMin = RealLast();
Standard_Real aZMin = RealLast();
Standard_Real aXMax = RealFirst();
Standard_Real aYMax = RealFirst();
Standard_Real aZMax = RealFirst();
Standard_Real aGroupXMin, aGroupYMin, aGroupZMin, aGroupXMax, aGroupYMax, aGroupZMax;
for (Standard_Integer aGroupIt = 1; aGroupIt <= MyGroups.Length(); aGroupIt++)
{
const Handle(Graphic3d_Group)& aGroup = MyGroups.Value (aGroupIt);
XMax = RF;
YMax = RF;
ZMax = RF;
Standard_Integer i, Length;
Length = MyGroups.Length ();
for (i=1; i<=Length; i++)
if (! (MyGroups.Value (i))->IsEmpty () ) {
(MyGroups.Value (i))->MinMaxValues(Xm, Ym, Zm, XM, YM, ZM);
if (Xm < XMin) XMin = Xm;
if (Ym < YMin) YMin = Ym;
if (Zm < ZMin) ZMin = Zm;
if (XM > XMax) XMax = XM;
if (YM > YMax) YMax = YM;
if (ZM > ZMax) ZMax = ZM;
if (aGroup->IsEmpty())
{
continue;
}
Length = MyDescendants.Length ();
for (i=1; i<=Length; i++)
if (! ((Graphic3d_Structure *)
(MyDescendants.Value (i)))->IsEmpty () ) {
((Graphic3d_Structure *)
(MyDescendants.Value (i)))->MinMaxValues (Xm, Ym, Zm, XM, YM, ZM);
if (Xm < XMin) XMin = Xm;
if (Ym < YMin) YMin = Ym;
if (Zm < ZMin) ZMin = Zm;
if (XM > XMax) XMax = XM;
if (YM > YMax) YMax = YM;
if (ZM > ZMax) ZMax = ZM;
aGroup->MinMaxValues (aGroupXMin, aGroupYMin, aGroupZMin, aGroupXMax, aGroupYMax, aGroupZMax);
aXMin = Min (aXMin, aGroupXMin);
aYMin = Min (aYMin, aGroupYMin);
aZMin = Min (aZMin, aGroupZMin);
aXMax = Max (aXMax, aGroupXMax);
aYMax = Max (aYMax, aGroupYMax);
aZMax = Max (aZMax, aGroupZMax);
}
if ((XMin == RL) && (YMin == RL) &&
(ZMin == RL) && (XMax == RF) &&
(YMax == RF) && (ZMax == RF)) {
// Case impossible as it would mean
// that the structure is empty
XMin = RF;
YMin = RF;
ZMin = RF;
XMax = RL;
YMax = RL;
ZMax = RL;
// Case impossible as it would mean that the structure is empty
if (aXMin == RealLast() && aYMin == RealLast() && aZMin == RealLast() &&
aXMax == RealFirst() && aYMax == RealFirst() && aZMax == RealFirst())
{
theXMin = RealFirst();
theYMin = RealFirst();
theZMin = RealFirst();
theXMax = RealLast();
theYMax = RealLast();
theZMax = RealLast();
}
theXMin = aXMin;
theYMin = aYMin;
theZMin = aZMin;
theXMax = aXMax;
theYMax = aYMax;
theZMax = aZMax;
}
//=============================================================================
//function : MinMaxCoordWithDescendants
//purpose :
//=============================================================================
void Graphic3d_Structure::MinMaxCoordWithDescendants (Standard_Real& theXMin,
Standard_Real& theYMin,
Standard_Real& theZMin,
Standard_Real& theXMax,
Standard_Real& theYMax,
Standard_Real& theZMax) const
{
if (IsEmpty())
{
theXMin = RealFirst();
theYMin = RealFirst();
theZMin = RealFirst();
theXMax = RealLast();
theYMax = RealLast();
theZMax = RealLast();
return;
}
Standard_Real aXMin, aYMin, aZMin, aXMax, aYMax, aZMax;
MinMaxCoord (aXMin, aYMin, aZMin, aXMax, aYMax, aZMax);
// Min-Max of the descendant structures
Standard_Real aDescXMin = RealLast();
Standard_Real aDescYMin = RealLast();
Standard_Real aDescZMin = RealLast();
Standard_Real aDescXMax = RealFirst();
Standard_Real aDescYMax = RealFirst();
Standard_Real aDescZMax = RealFirst();
for (Standard_Integer aStructIt = 1; aStructIt <= MyDescendants.Length(); aStructIt++)
{
Graphic3d_Structure* aStructure = (Graphic3d_Structure*) MyDescendants.Value (aStructIt);
if (aStructure->IsEmpty())
{
continue;
}
aStructure->MinMaxCoordWithDescendants (aXMin, aYMin, aZMin, aXMax, aYMax, aZMax);
aDescXMin = Min (aXMin, aDescXMin);
aDescYMin = Min (aYMin, aDescYMin);
aDescZMin = Min (aZMin, aDescZMin);
aDescXMax = Max (aXMax, aDescXMax);
aDescYMax = Max (aYMax, aDescYMax);
aDescZMax = Max (aZMax, aDescZMax);
}
if (aDescXMin != RealLast() || aDescYMin != RealLast() ||
aDescZMin != RealLast() || aDescXMax != RealFirst() ||
aDescYMax != RealFirst() || aDescZMax != RealFirst())
{
TColStd_Array2OfReal aTrsf(0, 3, 0, 3);
Transform (aTrsf);
TransformBoundaries (aTrsf, aDescXMin, aDescYMin, aDescZMin, aDescXMax, aDescYMax, aDescZMax);
aXMin = Min (aDescXMin, aXMin);
aYMin = Min (aDescYMin, aYMin);
aZMin = Min (aDescZMin, aZMin);
aXMax = Max (aDescXMax, aXMax);
aYMax = Max (aDescYMax, aYMax);
aZMax = Max (aDescZMax, aZMax);
}
// Case impossible as it would mean that the structure is empty
if (aXMin == RealLast() && aYMin == RealLast() && aZMin == RealLast() &&
aXMax == RealFirst() && aYMax == RealFirst() && aZMax == RealFirst())
{
theXMin = RealFirst();
theYMin = RealFirst();
theZMin = RealFirst();
theXMax = RealLast();
theYMax = RealLast();
theZMax = RealLast();
}
theXMin = aXMin;
theYMin = aYMin;
theZMin = aZMin;
theXMax = aXMax;
theYMax = aYMax;
theZMax = aZMax;
}
void Graphic3d_Structure::Transforms (const TColStd_Array2OfReal& ATrsf, const Standard_Real X, const Standard_Real Y, const Standard_Real Z, Standard_Real& NewX, Standard_Real& NewY, Standard_Real& NewZ) {
@ -1973,6 +2089,61 @@ Graphic3d_Vertex Graphic3d_Structure::Transforms (const TColStd_Array2OfReal& AT
}
//=============================================================================
//function : Transforms
//purpose :
//=============================================================================
void Graphic3d_Structure::TransformBoundaries (const TColStd_Array2OfReal& theTrsf,
Standard_Real& theXMin,
Standard_Real& theYMin,
Standard_Real& theZMin,
Standard_Real& theXMax,
Standard_Real& theYMax,
Standard_Real& theZMax)
{
Standard_Real aXMin, aYMin, aZMin, aXMax, aYMax, aZMax, anU, aV, aW;
Graphic3d_Structure::Transforms (theTrsf, theXMin, theYMin, theZMin, aXMin, aYMin, aZMin);
Graphic3d_Structure::Transforms (theTrsf, theXMax, theYMax, theZMax, aXMax, aYMax, aZMax);
Graphic3d_Structure::Transforms (theTrsf, theXMin, theYMin, theZMax, anU, aV, aW);
aXMin = Min (anU, aXMin); aXMax = Max (anU, aXMax);
aYMin = Min (aV, aYMin); aYMax = Max (aV, aYMax);
aZMin = Min (aW, aZMin); aZMax = Max (aW, aZMax);
Graphic3d_Structure::Transforms (theTrsf, theXMax, theYMin, theZMax, anU, aV, aW);
aXMin = Min (anU, aXMin); aXMax = Max (anU, aXMax);
aYMin = Min (aV, aYMin); aYMax = Max (aV, aYMax);
aZMin = Min (aW, aZMin); aZMax = Max (aW, aZMax);
Graphic3d_Structure::Transforms (theTrsf, theXMax, theYMin, theZMin, anU, aV, aW);
aXMin = Min (anU, aXMin); aXMax = Max (anU, aXMax);
aYMin = Min (aV, aYMin); aYMax = Max (aV, aYMax);
aZMin = Min (aW, aZMin); aZMax = Max (aW, aZMax);
Graphic3d_Structure::Transforms (theTrsf, theXMax, theYMax, theZMin, anU, aV, aW);
aXMin = Min (anU, aXMin); aXMax = Max (anU, aXMax);
aYMin = Min (aV, aYMin); aYMax = Max (aV, aYMax);
aZMin = Min (aW, aZMin); aZMax = Max (aW, aZMax);
Graphic3d_Structure::Transforms (theTrsf, theXMin, theYMax, theZMax, anU, aV, aW);
aXMin = Min (anU, aXMin); aXMax = Max (anU, aXMax);
aYMin = Min (aV, aYMin); aYMax = Max (aV, aYMax);
aZMin = Min (aW, aZMin); aZMax = Max (aW, aZMax);
Graphic3d_Structure::Transforms (theTrsf, theXMin, theYMax, theZMin, anU, aV, aW);
aXMin = Min (anU, aXMin); aXMax = Max (anU, aXMax);
aYMin = Min (aV, aYMin); aYMax = Max (aV, aYMax);
aZMin = Min (aW, aZMin); aZMax = Max (aW, aZMax);
theXMin = aXMin;
theYMin = aYMin;
theZMin = aZMin;
theXMax = aXMax;
theYMax = aYMax;
theZMax = aZMax;
}
void Graphic3d_Structure::Network (const Handle(Graphic3d_Structure)& AStructure, const Graphic3d_TypeOfConnection AType, Graphic3d_MapOfStructure& ASet) {
@ -2308,7 +2479,7 @@ void Graphic3d_Structure::GraphicHighlight (const Aspect_TypeOfHighlightMethod A
XMax = YMax = ZMax = 0.;
}
else {
MinMaxCoord
MinMaxCoordWithDescendants
(XMin, YMin, ZMin, XMax, YMax, ZMax);
}
MyCStructure.BoundBox.Pmin.x = float (XMin);

View File

@ -20,5 +20,6 @@
#include <Graphic3d_Vec3.hxx>
#include <Graphic3d_Vec4.hxx>
#include <Graphic3d_Mat4.hxx>
#include <Graphic3d_Mat4d.hxx>
#endif // _Graphic3d_Vec_H__

View File

@ -191,13 +191,13 @@ public:
//! Initialize the identity matrix.
void InitIdentity()
{
static const Element_t anIdentity[] =
{1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1};
std::memcpy (this, myIdentityArray, sizeof (NCollection_Mat4));
}
std::memcpy (this, anIdentity, sizeof (NCollection_Mat4));
//! Checks the matrix for identity.
bool IsIdentity() const
{
return std::memcmp (this, myIdentityArray, sizeof (NCollection_Mat4)) == 0;
}
//! Raw access to the data (for OpenGL exchange).
@ -429,6 +429,16 @@ private:
Element_t myMat[16];
private:
static Element_t myIdentityArray[16];
};
template<typename Element_t>
Element_t NCollection_Mat4<Element_t>::myIdentityArray[] =
{1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1};
#endif // _NCollection_Mat4_HeaderFile

View File

@ -106,114 +106,26 @@ void NIS_View::RemoveContext (NIS_InteractiveContext * theCtx)
Standard_Boolean NIS_View::FitAll3d (const Quantity_Coefficient theCoef)
{
Standard_Boolean aResult(Standard_False);
Bnd_B3f aBox = GetBndBox();
// Check that the box is not empty
if (aBox.IsVoid() == Standard_False && MyView->IsDefined() == Standard_True)
if (aBox.IsVoid() || MyView->IsDefined() == Standard_False)
{
// Convert the 3D box to 2D representation in view coordinates
gp_XYZ aCoord;
return Standard_False;
}
const gp_XYZ aCorner[2] = { aBox.CornerMin(), aBox.CornerMax() };
gp_XYZ aMin = aBox.CornerMin();
gp_XYZ aMax = aBox.CornerMax();
// Fit depth
const gp_XYZ& aBMin = aCorner[0];
const gp_XYZ& aBMax = aCorner[1];
gp_Pnt anAABBCenter ((aBMin.X() + aBMax.X()) * 0.5,
(aBMin.Y() + aBMax.Y()) * 0.5,
(aBMin.Z() + aBMax.Z()) * 0.5);
gp_Vec aCenter2AABB (myCamera->Center(), anAABBCenter);
gp_Dir aDir = myCamera->Direction();
// distance projection onto camera direction
Standard_Real aDistToBox = -aCenter2AABB.Dot (aDir);
gp_Vec aZShift = gp_Vec (aDir).Reversed().Scaled (aDistToBox);
gp_Pnt anEyeBefore = myCamera->Eye();
gp_Pnt aCenterBefore = myCamera->Center();
myCamera->BeginUpdate();
myCamera->SetEye (myCamera->Eye().Translated (aZShift));
myCamera->SetCenter (myCamera->Center().Translated (aZShift));
myCamera->EndUpdate();
Standard_Real Umin = RealLast();
Standard_Real Umax = RealFirst();
Standard_Real Vmin = RealLast();
Standard_Real Vmax = RealFirst();
Standard_Real U, V, W;
Standard_Boolean doFit = Standard_True;
while (doFit)
if (!FitMinMax (myCamera, aMin, aMax, theCoef, 0.0, Standard_False))
{
for (Standard_Integer i = 0; i < 8; i++) {
if (i & 0x1) aCoord.SetX (aCorner[0].X());
else aCoord.SetX (aCorner[1].X());
if (i & 0x2) aCoord.SetY (aCorner[0].Y());
else aCoord.SetY (aCorner[1].Y());
if (i & 0x4) aCoord.SetZ (aCorner[0].Z());
else aCoord.SetZ (aCorner[1].Z());
MyView->Projects(aCoord.X(), aCoord.Y(), aCoord.Z(), U, V, W);
if (i) {
Umin = Min(Umin, U); Umax = Max(Umax, U);
Vmin = Min(Vmin, V); Vmax = Max(Vmax, V);
}
else {
Umin = Umax = U;
Vmin = Vmax = V;
}
return Standard_False;
}
if ( (Umax > Umin) && (Vmax > Vmin) )
{
gp_Pnt ViewDims = myCamera->ViewDimensions();
Standard_Real DxvOld = ViewDims.X();
AutoZFit();
Standard_Real Xrp, Yrp, DxvNew, DyvNew;
ImmediateUpdate();
DxvNew = Abs(Umax - Umin); DyvNew = Abs(Vmax - Vmin);
DxvNew *= (1. + theCoef);
DyvNew *= (1. + theCoef);
Standard_Real aRatio = DxvNew / DxvOld;
Xrp = (Umin + Umax)/2. ; Yrp = (Vmin + Vmax)/2. ;
Umin = Xrp - DxvNew/2. ; Umax = Xrp + DxvNew/2. ;
Vmin = Yrp - DyvNew/2. ; Vmax = Yrp + DyvNew/2. ;
// fit view
FitAll (Umin, Vmin, Umax, Vmax);
// ratio 1e+6 often gives calculation error(s), reduce it
// if (aRatio < 1e+6) doFit = Standard_False;
if (aRatio < 100)
{
doFit = Standard_False;
}
aResult = Standard_True;
}
else
{
doFit = Standard_False;
}
}
if (!aResult)
{
myCamera->BeginUpdate();
myCamera->SetCenter (aCenterBefore);
myCamera->SetEye (anEyeBefore);
myCamera->EndUpdate();
}
}
return aResult;
return Standard_True;
}
//=======================================================================

View File

@ -32,6 +32,7 @@
#include <OpenGl_Workspace.hxx>
#include <Graphic3d_TextureEnv.hxx>
#include <Graphic3d_Mat4d.hxx>
IMPLEMENT_STANDARD_HANDLE(OpenGl_View,MMgt_TShared)
IMPLEMENT_STANDARD_RTTIEXT(OpenGl_View,MMgt_TShared)
@ -470,16 +471,15 @@ const TEL_TRANSFORM_PERSISTENCE* OpenGl_View::BeginTransformPersistence (const H
void OpenGl_View::GetMatrices (TColStd_Array2OfReal& theMatOrient,
TColStd_Array2OfReal& theMatMapping) const
{
const OpenGl_Matrix* aProj = (const OpenGl_Matrix*) &myCamera->ProjectionMatrix();
const OpenGl_Matrix* aOrient = (const OpenGl_Matrix*) &myCamera->OrientationMatrix();
const Graphic3d_Mat4d& aProj = myCamera->ProjectionMatrix();
const Graphic3d_Mat4d& aOrient = myCamera->OrientationMatrix();
int i, j;
for (i = 0; i < 4; ++i)
for (Standard_Integer aRow = 0; aRow < 4; ++aRow)
{
for (j = 0; j < 4; ++j)
for (Standard_Integer aCol = 0; aCol < 4; ++aCol)
{
theMatOrient (i, j) = aOrient->mat[j][i];
theMatMapping (i, j) = aProj-> mat[j][i];
theMatOrient (aRow, aCol) = aOrient.GetValue (aRow, aCol);
theMatMapping (aRow, aCol) = aProj .GetValue (aRow, aCol);
}
}
}

View File

@ -401,13 +401,13 @@ void OpenGl_View::Render (const Handle(OpenGl_PrinterContext)& thePrintContext,
if (myProjectionState != myCamera->ProjectionState())
{
myProjectionState = myCamera->ProjectionState();
aManager->UpdateProjectionStateTo ((const Tmatrix3*)myCamera->ProjectionMatrix().GetData());
aManager->UpdateProjectionStateTo ((const Tmatrix3*)myCamera->ProjectionMatrixF().GetData());
}
if (myModelViewState != myCamera->ModelViewState())
{
myModelViewState = myCamera->ModelViewState();
aManager->UpdateWorldViewStateTo ((const Tmatrix3*)myCamera->OrientationMatrix().GetData());
aManager->UpdateWorldViewStateTo ((const Tmatrix3*)myCamera->OrientationMatrixF().GetData());
}
if (aManager->ModelWorldState().Index() == 0)
@ -515,9 +515,9 @@ void OpenGl_View::Render (const Handle(OpenGl_PrinterContext)& thePrintContext,
if (!myCamera->IsStereo() || !aContext->HasStereoBuffers())
{
// single-pass monographic rendering
const OpenGl_Matrix* aProj = (const OpenGl_Matrix*) &myCamera->ProjectionMatrix();
const OpenGl_Matrix* aProj = (const OpenGl_Matrix*) &myCamera->ProjectionMatrixF();
const OpenGl_Matrix* aOrient = (const OpenGl_Matrix*) &myCamera->OrientationMatrix();
const OpenGl_Matrix* aOrient = (const OpenGl_Matrix*) &myCamera->OrientationMatrixF();
// redraw scene with normal orientation and projection
RedrawScene (thePrintContext, theWorkspace, aProj, aOrient);
@ -525,9 +525,9 @@ void OpenGl_View::Render (const Handle(OpenGl_PrinterContext)& thePrintContext,
else
{
// two stereographic passes
const OpenGl_Matrix* aLProj = (const OpenGl_Matrix*) &myCamera->ProjectionStereoLeft();
const OpenGl_Matrix* aRProj = (const OpenGl_Matrix*) &myCamera->ProjectionStereoRight();
const OpenGl_Matrix* aOrient = (const OpenGl_Matrix*) &myCamera->OrientationMatrix();
const OpenGl_Matrix* aLProj = (const OpenGl_Matrix*) &myCamera->ProjectionStereoLeftF();
const OpenGl_Matrix* aRProj = (const OpenGl_Matrix*) &myCamera->ProjectionStereoRightF();
const OpenGl_Matrix* aOrient = (const OpenGl_Matrix*) &myCamera->OrientationMatrixF();
// safely switch to left Eye buffer
aContext->SetDrawBufferLeft();

View File

@ -33,12 +33,14 @@
#include <gp_Ax2.hxx>
#include <Geom_Circle.hxx>
#include <AIS_Circle.hxx>
#include <V3d_View.hxx>
#include <TopoDS.hxx>
#include <Geom_Plane.hxx>
#include <gp_Pln.hxx>
#include <AIS_AngleDimension.hxx>
#include <Aspect_Window.hxx>
#include <V3d_View.hxx>
#include <TopExp_Explorer.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <GC_MakePlane.hxx>
@ -163,65 +165,63 @@ static Standard_Integer BUC60814(Draw_Interpretor& di, Standard_Integer argc, c
return 0;
}
static Standard_Integer BUC60774(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
//=======================================================================
//function : BUC60774
//purpose :
//=======================================================================
static Standard_Integer BUC60774 (Draw_Interpretor& theDi,
Standard_Integer theArgNb,
const char** theArgv)
{
if(argc!=1)
if (theArgNb != 1)
{
di << "Usage : " << argv[0] << "\n";
std::cout << "Usage : " << theArgv[0] << "\n";
return -1;
}
Handle(AIS_InteractiveContext) myAISContext = ViewerTest::GetAISContext();
if(myAISContext.IsNull())
const Handle(AIS_InteractiveContext)& anAISContext = ViewerTest::GetAISContext();
if (anAISContext.IsNull())
{
di << "use 'vinit' command before " << argv[0] << "\n";
std::cout << "use 'vinit' command before " << theArgv[0] << "\n";
return -1;
}
Handle(V3d_View) myV3dView = ViewerTest::CurrentView();
const Handle(V3d_View)& aV3dView = ViewerTest::CurrentView();
double Xc,Yc,Width, Height;
myV3dView->Center(Xc,Yc);
myV3dView-> Size (Width, Height);
Standard_Integer aWinWidth = 0;
Standard_Integer aWinHeight = 0;
aV3dView->Window()->Size (aWinWidth, aWinHeight);
double Xmin,Ymin;
Xmin=Xc-Width/2;
Ymin=Yc-Height/2;
double Xmax,Ymax;
Xmax=Xc+Width/2;
Ymax=Yc+Height/2;
Standard_Integer aXPixMin = 0;
Standard_Integer aYPixMin = 0;
Standard_Integer aXPixMax = aWinWidth;
Standard_Integer aYPixMax = aWinHeight;
Standard_Integer XPmin,YPmin;
myV3dView->Convert(Xmin,Ymin,XPmin,YPmin);
// cout<<Xmin<<"\t"<<Ymin<<endl;
// cout<<XPmin<<"\t"<<YPmin<<endl;
AIS_StatusOfPick aPickStatus = anAISContext->Select (aXPixMin, aYPixMin, aXPixMax, aYPixMax, aV3dView);
theDi << (aPickStatus == AIS_SOP_NothingSelected
? "status = AIS_SOP_NothingSelected : OK"
: "status = AIS_SOP_NothingSelected : bugged - Faulty ");
theDi << "\n";
Standard_Integer XPmax,YPmax;
myV3dView->Convert(Xmax,Ymax,XPmax,YPmax);
// cout<<Xmax<<"\t"<<Ymax<<endl;
// cout<<XPmax<<"\t"<<YPmax<<endl;
theDi.Eval ("box b 10 10 10");
theDi.Eval (" vdisplay b");
AIS_StatusOfPick status;
if ((status=myAISContext->Select(XPmin,YPmin,XPmax,YPmax,myV3dView))==AIS_SOP_NothingSelected)
di << "status = AIS_SOP_NothingSelected : OK" << "\n";
else di << "status = AIS_SOP_NothingSelected : bugged - Faulty " << "\n";
aPickStatus = anAISContext->Select (aXPixMin, aYPixMin, aXPixMax, aYPixMax, aV3dView);
theDi << (aPickStatus == AIS_SOP_OneSelected
? "status = AIS_SOP_OneSelected : OK"
: "status = AIS_SOP_OneSelected : bugged - Faulty ");
theDi << "\n";
di.Eval("box b 10 10 10");
di.Eval(" vdisplay b");
theDi.Eval ("box w 20 20 20 20 20 20");
theDi.Eval (" vdisplay w");
if ((status=myAISContext->Select(XPmin,YPmin,XPmax,YPmax,myV3dView))==AIS_SOP_OneSelected)
di << "status = AIS_SOP_OneSelected : OK" << "\n";
else di << "status = AIS_SOP_OneSelected : bugged - Faulty " << "\n";
di.Eval("box w 20 20 20 20 20 20");
di.Eval(" vdisplay w");
if ((status=myAISContext->Select(XPmin,YPmin,XPmax,YPmax,myV3dView))==AIS_SOP_SeveralSelected)
di << "status = AIS_SOP_SeveralSelected : OK" << "\n";
else di << "status = AIS_SOP_SeveralSelected : bugged - Faulty " << "\n";
aPickStatus = anAISContext->Select (aXPixMin, aYPixMin, aXPixMax, aYPixMax, aV3dView);
theDi << (aPickStatus == AIS_SOP_SeveralSelected
? "status = AIS_SOP_SeveralSelected : OK"
: "status = AIS_SOP_SeveralSelected : bugged - Faulty ");
theDi << "\n";
return 0;
}
static Standard_Integer BUC60972 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)

View File

@ -37,7 +37,8 @@ uses
TopLoc,
Geom,
SelectBasics,
V3d
V3d,
Graphic3d
is

View File

@ -45,169 +45,205 @@ uses
Vec2d from gp,
Pnt2d from gp,
Box from Bnd,
View from V3d
View from V3d,
Mat4 from Graphic3d,
Mat4d from Graphic3d
raises
NoSuchObject from Standard
is
Create(aView:View from V3d) returns Projector from Select3D;
--- Purpose: Constructs the 3D projector object defined by the 3D view aView.
Create returns Projector from Select3D;
Create (theView : View from V3d) returns Projector from Select3D;
--- Purpose: Constructs the 3D projector object from the passed view.
-- The projector captures current model-view and projection transformation
-- of the passed view.
Create(CS : Ax2 from gp)
---Purpose: Creates an axonometric projector. <CS> represents viewing coordinate
-- system and could be constructed from x direction, view plane normal direction,
-- and view point location in world-coordinate space.
Create returns Projector from Select3D;
--- Purpose: Constructs identity projector.
Create (theCS : Ax2 from gp)
---Purpose: Builds the Projector from the model-view transformation specified
-- by the passed viewing coordinate system <theCS>. The Projector has
-- identity projection transformation, is orthogonal.
-- The viewing coordinate system could be constructed from x direction,
-- view plane normal direction, and view point location in
-- world-coordinate space.
returns Projector from Select3D;
Create(CS : Ax2 from gp;
Focus : Real from Standard)
---Purpose: Creates a perspective projector. <CS> represents viewing
-- coordinate system and could be constructed from x direction,
Create (theCS : Ax2 from gp;
theFocus : Real from Standard)
---Purpose: Builds the Projector from the model-view transformation specified
-- by the passed view coordinate system <theCS> and simplified perspective
-- projection transformation defined by <theFocus> parameter.
-- The viewing coordinate system could be constructed from x direction,
-- view plane normal direction, and focal point location in world-coordinate
-- space. <Focus> should represent distance of an eye from view plane
-- space. <theFocus> should represent distance of an eye from view plane
-- in world-coordinate space (focal distance).
returns Projector from Select3D;
Create(T : Trsf from gp;
Persp : Boolean from Standard;
Focus : Real from Standard)
---Purpose: build a Projector from the given transformation.
-- In case, when <T> transformation should represent custom view projection,
-- it could be constructed from two separate components: transposed view
-- orientation matrix and translation of focal point in view-coordiante
-- system. <T> could be built up from x direction, up direction,
Create (theViewTrsf : Trsf from gp;
theIsPersp : Boolean from Standard;
theFocus : Real from Standard)
---Purpose: Build the Projector from the model-view transformation passed
-- as <theViewTrsf> and simplified perspective projection transformation
-- parameters passed as <theIsPersp> and <theFocus>.
-- In case, when <theViewTrsf> transformation should represent custom view
-- projection, it could be constructed from two separate components:
-- transposed view orientation matrix and translation of focal point
-- in view-coordinate system.
-- <theViewTrsf> could be built up from x direction, up direction,
-- view plane normal direction vectors and translation with SetValues(...)
-- method, where first row arguments (a11, a12, a13, a14) are x, y, z
-- component of x direction vector, and x value of reversed translation
-- vector. Second row arguments, are x y z for up direction and y value of
-- reversed translation, and the third row defined in the same manner.
-- This also suits for simple perspective view, where <Focus> is the focale
-- distance of an eye from view plane in world-space coordiantes.
-- This also suits for simple perspective view, where <theFocus> is the focale
-- distance of an eye from view plane in world-space coordinates.
-- Note, that in that case amount of perspective distortion (perspective
-- angle) should be defined through focal distance.
returns Projector from Select3D;
Create(GT : GTrsf from gp;
Persp : Boolean from Standard;
Focus : Real from Standard)
---Purpose: build a Projector from the given transformation.
-- In case, when <GT> transformation should represent custom view
Create (theViewTrsf : GTrsf from gp;
theIsPersp : Boolean from Standard;
theFocus : Real from Standard)
---Purpose: Builds the Projector from the model-view transformation passed
-- as <theViewTrsf> and projection transformation for <theIsPersp> and
-- <theFocus> parameters.
-- In case, when <theViewTrsf> transformation should represent custom view
-- projection, it could be constructed from two separate components:
-- transposed view orientation matrix and translation of a focal point
-- in view-coordinate system.
-- This also suits for perspective view, with <Focus> that could be
-- This also suits for perspective view, with <theFocus> that could be
-- equal to distance from an eye to a view plane in
-- world-coordinates (focal distance).
-- The 3x3 transformation matrix is built up from three vectors:
-- x direction, up direction and view plane normal vectors, where each
-- vector is a matrix row. Then <GT> is constructed from matrix and
-- vector is a matrix row. Then <theViewTrsf> is constructed from matrix and
-- reversed translation with methods SetTranslationPart(..) and
-- SetVectorialPart(..).
-- Note, that in that case amount of perspective distortion (perspective
-- angle) should be defined through focal distance.
returns Projector from Select3D;
Create (theViewTrsf : Mat4d from Graphic3d;
theProjTrsf : Mat4d from Graphic3d)
---Purpose: Builds the Projector from the passed model-view <theViewTrsf>
-- and projection <theProjTrsf> transformation matrices.
returns Projector from Select3D;
Set (me : mutable;
T : Trsf from gp;
Persp : Boolean from Standard;
Focus : Real from Standard)
is static;
theViewTrsf : Trsf from gp;
theIsPersp : Boolean from Standard;
theFocus : Real from Standard);
---Purpose: Sets new parameters for the Projector.
SetView(me : mutable; V : View from V3d);
---Purpose: Sets the 3D view V used at the time of construction.
Set (me : mutable;
theViewTrsf : Mat4d from Graphic3d;
theProjTrsf : Mat4d from Graphic3d);
---Purpose: Sets new parameters for the Projector.
View(me) returns any View from V3d;
---Purpose: Returns the 3D view used at the time of construction.
---C++: return const&
---C++: inline
SetView (me : mutable;
theView : View from V3d);
---Purpose: Sets new parameters for the Projector
-- captured from the passed view.
Scaled(me : mutable; On : Boolean from Standard = Standard_False)
---Purpose: to compute with the given scale and translation.
Scaled (me : mutable; theToCheckOptimized : Boolean from Standard = Standard_False)
---Purpose: Pre-compute inverse transformation and ensure whether it is possible
-- to use optimized transformation for the common view-orientation type or not
-- if <theToCheckOptimized> is TRUE.
is virtual;
Perspective (me) returns Boolean
---Purpose: Returns True if there is a perspective transformation.
---Purpose: Returns True if there is simplified perspective
-- projection approach is used. Distortion defined by Focus.
---C++: inline
is virtual;
Focus (me) returns Real from Standard
---Purpose: Returns the focal length of simplified perspective
-- projection approach. Raises program error exception if the
-- the projection transformation is not specified as simplified
-- Perspective (for example, custom projection transformation is defined
-- or the orthogonal Projector is defined).
---C++: inline
is virtual;
Projection (me) returns Mat4d from Graphic3d;
---Purpose: Returns projection transformation. Please note that for
-- simplified perspective projection approach, defined by Focus, the
-- returned transformation is identity.
---C++: inline
---C++: return const &
Transformation (me) returns GTrsf from gp
---Purpose: Returns the active transformation.
---Purpose: Returns the view transformation.
---C++: inline
---C++: return const &
is virtual;
InvertedTransformation (me) returns GTrsf from gp
---Purpose: Returns the active inverted transformation.
---Purpose: Returns the inverted view transformation.
---C++: inline
---C++: return const &
is virtual;
FullTransformation (me) returns Trsf from gp
---Purpose: Returns the original transformation.
---Purpose: Returns the uniform-scaled view transformation.
---C++: inline
---C++: return const &
is virtual;
Focus(me) returns Real from Standard
---Purpose: Returns the focal length.
---C++: inline
raises
NoSuchObject from Standard -- if there is no perspective
is virtual;
Transform(me; D : in out Vec from gp)
Transform (me; theD : in out Vec from gp)
---Purpose: Transforms the vector into view-coordinate space.
---C++: inline
is virtual;
Transform(me; Pnt : in out Pnt from gp)
Transform (me; thePnt : in out Pnt from gp)
---Purpose: Transforms the point into view-coordinate space.
---C++: inline
is virtual;
Project(me; P : Pnt from gp;
Pout : out Pnt2d from gp)
---Purpose: Transform and apply perspective if needed.
Project (me; theP : Pnt from gp; thePout : out Pnt2d from gp)
---Purpose: Transforms the point into view-coordinate space
-- and applies projection transformation.
is virtual;
Project(me; P : Pnt from gp;
X,Y,Z : out Real from Standard)
---Purpose: Transform and apply perspective if needed.
Project (me; theP : Pnt from gp; theX, theY, theZ : out Real from Standard)
---Purpose: Transforms the point into view-coordinate space
-- and applies projection transformation.
is static;
Project(me; P : Pnt from gp;
D1 : Vec from gp;
Pout : out Pnt2d from gp;
D1out : out Vec2d from gp)
---Purpose: Transform and apply perspective if needed.
Project (me; theP : Pnt from gp;
theD1 : Vec from gp;
thePout : out Pnt2d from gp;
theD1out : out Vec2d from gp)
---Purpose: Transforms the point and vector passed from its location
-- into view-coordinate space and applies projection transformation.
is virtual;
Shoot(me; X , Y : Real from Standard)
returns Lin from gp
---Purpose: return a line going through the eye towards the
-- 2d point <X,Y>.
Shoot (me; theX, theY : Real from Standard) returns Lin from gp
---Purpose: Return projection line going through the 2d point <theX, theY>
is virtual;
Transform(me; P : in out Pnt from gp;
T : GTrsf from gp)
Transform(me; thePnt : in out Pnt from gp;
theTrsf : GTrsf from gp)
---C++: inline
is virtual;
Transform(me; D : in out Lin from gp;
T : GTrsf from gp)
Transform(me; theLin : in out Lin from gp;
theTrsf : GTrsf from gp)
---C++: inline
is virtual;
fields
myType : Integer from Standard;
myType : Integer from Standard;
myPersp : Boolean from Standard is protected;
myFocus : Real from Standard is protected;
myScaledTrsf : Trsf from gp is protected;
myGTrsf : GTrsf from gp is protected;
myInvTrsf : GTrsf from gp is protected;
myView : View from V3d;
myScaledTrsf : Trsf from gp is protected;
myProjTrsf : Mat4d from Graphic3d is protected;
end Projector;

View File

@ -14,14 +14,83 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#define IMP240100 //GG
// Change RefToPix()/Convert() to Project() method.
#include <Select3D_Projector.ixx>
#include <Precision.hxx>
#include <gp_Ax3.hxx>
#include <gp_Vec.hxx>
#include <gp_Vec2d.hxx>
#include <gp_Mat.hxx>
#include <Graphic3d_Vec4.hxx>
namespace
{
//=======================================================================
//function : TrsfType
//purpose :
//=======================================================================
static Standard_Integer TrsfType(const gp_GTrsf& theTrsf)
{
const gp_Mat& aMat = theTrsf.VectorialPart();
if ((Abs (aMat.Value (1, 1) - 1.0) < 1e-15)
&& (Abs (aMat.Value (2, 2) - 1.0) < 1e-15)
&& (Abs (aMat.Value (3, 3) - 1.0) < 1e-15))
{
return 1; // top
}
else if ((Abs (aMat.Value (1, 1) - 0.7071067811865476) < 1e-15)
&& (Abs (aMat.Value (1, 2) + 0.5) < 1e-15)
&& (Abs (aMat.Value (1, 3) - 0.5) < 1e-15)
&& (Abs (aMat.Value (2, 1) - 0.7071067811865476) < 1e-15)
&& (Abs (aMat.Value (2, 2) - 0.5) < 1e-15)
&& (Abs (aMat.Value (2, 3) + 0.5) < 1e-15)
&& (Abs (aMat.Value (3, 1)) < 1e-15)
&& (Abs (aMat.Value (3, 2) - 0.7071067811865476) < 1e-15)
&& (Abs (aMat.Value (3, 3) - 0.7071067811865476) < 1e-15))
{
return 0; // inverse axo
}
else if ((Abs (aMat.Value (1, 1) - 1.0) < 1e-15)
&& (Abs (aMat.Value (2, 3) - 1.0) < 1e-15)
&& (Abs (aMat.Value (3, 2) + 1.0) < 1e-15))
{
return 2; // front
}
else if ((Abs (aMat.Value (1, 1) - 0.7071067811865476) < 1e-15)
&& (Abs (aMat.Value (1, 2) - 0.7071067811865476) < 1e-15)
&& (Abs (aMat.Value (1, 3)) < 1e-15)
&& (Abs (aMat.Value (2, 1) + 0.5) < 1e-15)
&& (Abs (aMat.Value (2, 2) - 0.5) < 1e-15)
&& (Abs (aMat.Value (2, 3) - 0.7071067811865476) < 1e-15)
&& (Abs (aMat.Value (3, 1) - 0.5) < 1e-15)
&& (Abs (aMat.Value (3, 2) + 0.5) < 1e-15)
&& (Abs (aMat.Value (3, 3) - 0.7071067811865476) < 1e-15))
{
return 3; // axo
}
return -1;
}
//====== TYPE 0 (inverse axonometric)
// (0.7071067811865476, -0.5 , 0.4999999999999999)
// (0.7071067811865475, 0.5000000000000001, -0.5 )
// (0.0, 0.7071067811865475, 0.7071067811865476)
// ====== TYPE 1 (top)
// (1.0, 0.0, 0.0)
// (0.0, 1.0, 0.0)
// (0.0, 0.0, 1.0)
// ======= TYPE 2 (front)
// (1.0, 0.0 , 0.0)
// (0.0, 1.110223024625157e-16 , 1.0)
// (0.0, -1.0 , 1.110223024625157e-16)
// ======= TYPE 3 (axonometric)
// ( 0.7071067811865476, 0.7071067811865475, 0.0)
// (-0.5 , 0.5000000000000001, 0.7071067811865475)
// ( 0.4999999999999999, -0.5 , 0.7071067811865476)
}
// formula for derivating a perspective, from Mathematica
@ -35,20 +104,22 @@
//function : Select3D_Projector
//purpose :
//=======================================================================
Select3D_Projector::Select3D_Projector(const Handle(V3d_View)& aViou)
: myView (aViou)
Select3D_Projector::Select3D_Projector (const Handle(V3d_View)& theView)
: myPersp (Standard_False),
myFocus (0.0),
myType (-1)
{
SetView (theView);
}
//=======================================================================
//function : Select3D_Projector
//purpose :
//=======================================================================
Select3D_Projector::Select3D_Projector()
: myPersp (Standard_False),
myFocus(0)
myFocus (0.0),
myType (-1)
{
Scaled();
}
@ -57,12 +128,12 @@ Select3D_Projector::Select3D_Projector()
//function : Select3D_Projector
//purpose :
//=======================================================================
Select3D_Projector::Select3D_Projector (const gp_Ax2& CS)
Select3D_Projector::Select3D_Projector (const gp_Ax2& theCS)
: myPersp (Standard_False),
myFocus(0)
myFocus (0.0),
myType (-1)
{
myScaledTrsf.SetTransformation(CS);
myScaledTrsf.SetTransformation (theCS);
myGTrsf.SetTrsf (myScaledTrsf);
Scaled();
}
@ -71,13 +142,12 @@ Select3D_Projector::Select3D_Projector (const gp_Ax2& CS)
//function : Select3D_Projector
//purpose :
//=======================================================================
Select3D_Projector::Select3D_Projector (const gp_Ax2& CS,
const Standard_Real Focus)
Select3D_Projector::Select3D_Projector (const gp_Ax2& theCS, const Standard_Real theFocus)
: myPersp (Standard_True),
myFocus(Focus)
myFocus (theFocus),
myType (-1)
{
myScaledTrsf.SetTransformation(CS);
myScaledTrsf.SetTransformation (theCS);
myGTrsf.SetTrsf (myScaledTrsf);
Scaled();
}
@ -86,15 +156,15 @@ Select3D_Projector::Select3D_Projector (const gp_Ax2& CS,
//function : Select3D_Projector
//purpose :
//=======================================================================
Select3D_Projector::Select3D_Projector (const gp_Trsf& T,
const Standard_Boolean Persp,
const Standard_Real Focus)
: myPersp(Persp),
myFocus(Focus),
myScaledTrsf(T)
Select3D_Projector::Select3D_Projector (const gp_Trsf& theViewTrsf,
const Standard_Boolean theIsPersp,
const Standard_Real theFocus)
: myPersp (theIsPersp),
myFocus (theFocus),
myGTrsf (theViewTrsf),
myScaledTrsf (theViewTrsf),
myType (-1)
{
myGTrsf.SetTrsf(myScaledTrsf);
Scaled();
}
@ -102,361 +172,300 @@ Select3D_Projector::Select3D_Projector (const gp_Trsf& T,
//function : Select3D_Projector
//purpose :
//=======================================================================
Select3D_Projector::Select3D_Projector (const gp_GTrsf& GT,
const Standard_Boolean Persp,
const Standard_Real Focus)
: myPersp(Persp),
myFocus(Focus),
myGTrsf(GT)
Select3D_Projector::Select3D_Projector (const gp_GTrsf& theViewTrsf,
const Standard_Boolean theIsPersp,
const Standard_Real theFocus)
: myPersp (theIsPersp),
myFocus (theFocus),
myGTrsf (theViewTrsf),
myScaledTrsf (theViewTrsf.Trsf()),
myType (-1)
{
Scaled();
}
//=======================================================================
//function : Select3D_Projector
//purpose :
//=======================================================================
Select3D_Projector::Select3D_Projector (const Graphic3d_Mat4d& theViewTrsf,
const Graphic3d_Mat4d& theProjTrsf)
: myPersp (Standard_False),
myFocus (0.0),
myType (-1)
{
Set (theViewTrsf, theProjTrsf);
}
//=======================================================================
//function : Set
//purpose :
//=======================================================================
void Select3D_Projector::Set (const gp_Trsf& theViewTrsf,
const Standard_Boolean theIsPersp,
const Standard_Real theFocus)
{
myPersp = theIsPersp;
myFocus = theFocus;
myScaledTrsf = theViewTrsf;
myProjTrsf.InitIdentity();
Scaled();
}
//=======================================================================
//function : Set
//purpose :
//=======================================================================
void Select3D_Projector::Set
(const gp_Trsf& T,
const Standard_Boolean Persp,
const Standard_Real Focus)
void Select3D_Projector::Set (const Graphic3d_Mat4d& theViewTrsf,
const Graphic3d_Mat4d& theProjTrsf)
{
myPersp = Persp;
myFocus = Focus;
myScaledTrsf = T;
// Copy elements corresponding to common view-transformation
for (Standard_Integer aRowIt = 0; aRowIt < 3; ++aRowIt)
{
for (Standard_Integer aColIt = 0; aColIt < 4; ++aColIt)
{
myGTrsf.SetValue (aRowIt + 1, aColIt + 1, theViewTrsf.GetValue (aRowIt, aColIt));
}
}
// Adapt scaled transformation for compatibilty
gp_Dir aViewY (theViewTrsf.GetValue (0, 1), theViewTrsf.GetValue (1, 1), theViewTrsf.GetValue (2, 1));
gp_Dir aViewZ (theViewTrsf.GetValue (0, 2), theViewTrsf.GetValue (1, 2), theViewTrsf.GetValue (2, 2));
gp_XYZ aViewT (theViewTrsf.GetValue (0, 3), theViewTrsf.GetValue (1, 3), theViewTrsf.GetValue (2, 3));
gp_Dir aViewX = aViewY ^ aViewZ;
gp_Ax3 aViewAx3 (gp_Pnt (aViewT), aViewZ, aViewX);
myScaledTrsf.SetTransformation (aViewAx3);
myPersp = Standard_False;
myFocus = 0.0;
myProjTrsf = theProjTrsf;
Scaled();
}
//=======================================================================
//function : SetView
//purpose :
//=======================================================================
void Select3D_Projector::SetView (const Handle(V3d_View)& theView)
{
const Graphic3d_Mat4d& aViewTrsf = theView->Camera()->OrientationMatrix();
const Graphic3d_Mat4d& aProjTrsf = theView->Camera()->ProjectionMatrix();
gp_XYZ aFrameScale = theView->Camera()->ViewDimensions();
Graphic3d_Mat4d aScale;
aScale.ChangeValue (0, 0) = aFrameScale.X();
aScale.ChangeValue (1, 1) = aFrameScale.Y();
aScale.ChangeValue (2, 2) = aFrameScale.Z();
Graphic3d_Mat4d aScaledProjTrsf = aScale * aProjTrsf;
Set (aViewTrsf, aScaledProjTrsf);
}
//=======================================================================
//function : Scaled
//purpose :
//=======================================================================
#include <gp_Mat.hxx>
static Standard_Integer TrsfType(const gp_GTrsf& Trsf) {
const gp_Mat& Mat = Trsf.VectorialPart();
if( (Abs(Mat.Value(1,1)-1.0) < 1e-15)
&& (Abs(Mat.Value(2,2)-1.0) < 1e-15)
&& (Abs(Mat.Value(3,3)-1.0) < 1e-15)) {
return(1); //-- top
}
else if( (Abs(Mat.Value(1,1)-0.7071067811865476) < 1e-15)
&& (Abs(Mat.Value(1,2)+0.5) < 1e-15)
&& (Abs(Mat.Value(1,3)-0.5) < 1e-15)
&& (Abs(Mat.Value(2,1)-0.7071067811865476) < 1e-15)
&& (Abs(Mat.Value(2,2)-0.5) < 1e-15)
&& (Abs(Mat.Value(2,3)+0.5) < 1e-15)
&& (Abs(Mat.Value(3,1)) < 1e-15)
&& (Abs(Mat.Value(3,2)-0.7071067811865476) < 1e-15)
&& (Abs(Mat.Value(3,3)-0.7071067811865476) < 1e-15)) {
return(0); //--
}
else if( (Abs(Mat.Value(1,1)-1.0) < 1e-15)
&& (Abs(Mat.Value(2,3)-1.0) < 1e-15)
&& (Abs(Mat.Value(3,2)+1.0) < 1e-15)) {
return(2); //-- front
}
else if( (Abs(Mat.Value(1,1)-0.7071067811865476) < 1e-15)
&& (Abs(Mat.Value(1,2)-0.7071067811865476) < 1e-15)
&& (Abs(Mat.Value(1,3)) < 1e-15)
&& (Abs(Mat.Value(2,1)+0.5) < 1e-15)
&& (Abs(Mat.Value(2,2)-0.5) < 1e-15)
&& (Abs(Mat.Value(2,3)-0.7071067811865476) < 1e-15)
&& (Abs(Mat.Value(3,1)-0.5) < 1e-15)
&& (Abs(Mat.Value(3,2)+0.5) < 1e-15)
&& (Abs(Mat.Value(3,3)-0.7071067811865476) < 1e-15)) {
return(3); //-- axo
}
return(-1);
}
void Select3D_Projector::Scaled (const Standard_Boolean On)
void Select3D_Projector::Scaled (const Standard_Boolean theToCheckOptimized)
{
myType = -1;
if (!On) {
if (!myPersp) {
//myGTrsf.SetTranslationPart(gp_XYZ(0.,0.,0.));
if (!theToCheckOptimized && !myPersp && myProjTrsf.IsIdentity())
{
myType = TrsfType (myGTrsf);
}
}
myInvTrsf = myGTrsf;
myInvTrsf.Invert();
myInvTrsf = myGTrsf.Inverted();
}
//=======================================================================
//function : Project
//purpose :
//=======================================================================
void Select3D_Projector::Project (const gp_Pnt& P, gp_Pnt2d& Pout) const
void Select3D_Projector::Project (const gp_Pnt& theP, gp_Pnt2d& thePout) const
{
if(!myView.IsNull()){
Standard_Real Xout,Yout;
// V3d_View
#ifdef IMP240100
myView->Project(P.X(),P.Y(),P.Z(),Xout,Yout);
#else
Standard_Integer Xp,Yp;
myView->RefToPix(P.X(),P.Y(),P.Z(),Xp,Yp);
myView->Convert(Xp,Yp,Xout,Yout);
#endif
Pout.SetCoord(Xout,Yout);
}
else{
if(myType!=-1) {
Standard_Real X,Y;
switch (myType) {
case 0: { //-- axono standard
Standard_Real x07 = P.X()*0.7071067811865475;
Standard_Real y05 = P.Y()*0.5;
Standard_Real z05 = P.Z()*0.5;
X=x07-y05+z05;
Y=x07+y05-z05;
//-- Z=0.7071067811865475*(P.Y()+P.Z());
break;
}
case 1: { //-- top
X=P.X(); Y=P.Y(); //-- Z=P.Z();
Pout.SetCoord(X,Y);
break;
}
case 2: {
X=P.X(); Y=P.Z(); //-- Z=-P.Y();
Pout.SetCoord(X,Y);
break;
}
case 3: {
Standard_Real xmy05 = (P.X()-P.Y())*0.5;
Standard_Real z07 = P.Z()*0.7071067811865476;
X=0.7071067811865476*(P.X()+P.Y());
Y=-xmy05+z07;
Pout.SetCoord(X,Y);
//-- Z= xmy05+z07;
break;
}
default: {
gp_Pnt P2 = P;
Transform(P2);
if (myPersp) {
Standard_Real R = 1.-P2.Z()/myFocus;
Pout.SetCoord(P2.X()/R,P2.Y()/R);
}
else
Pout.SetCoord(P2.X(),P2.Y());
break;
}
}
}
else {
gp_Pnt P2 = P;
Transform(P2);
if (myPersp) {
Standard_Real R = 1.-P2.Z()/myFocus;
Pout.SetCoord(P2.X()/R,P2.Y()/R);
}
else
Pout.SetCoord(P2.X(),P2.Y());
}
}
Standard_Real aXout = 0.0;
Standard_Real aYout = 0.0;
Standard_Real aZout = 0.0;
Project (theP, aXout, aYout, aZout);
thePout.SetCoord (aXout, aYout);
}
//=======================================================================
//function : Project
//purpose :
//=======================================================================
/* ====== TYPE 0 (??)
(0.7071067811865476, -0.5 , 0.4999999999999999)
(0.7071067811865475, 0.5000000000000001, -0.5 )
(0.0, 0.7071067811865475, 0.7071067811865476)
====== TYPE 1 (top)
(1.0, 0.0, 0.0)
(0.0, 1.0, 0.0)
(0.0, 0.0, 1.0)
======= TYPE 2 (front)
(1.0, 0.0 , 0.0)
(0.0, 1.110223024625157e-16 , 1.0)
(0.0, -1.0 , 1.110223024625157e-16)
======= TYPE 3
( 0.7071067811865476, 0.7071067811865475, 0.0)
(-0.5 , 0.5000000000000001, 0.7071067811865475)
( 0.4999999999999999, -0.5 , 0.7071067811865476)
*/
void Select3D_Projector::Project (const gp_Pnt& P,
Standard_Real& X,
Standard_Real& Y,
Standard_Real& Z) const
void Select3D_Projector::Project (const gp_Pnt& theP,
Standard_Real& theX,
Standard_Real& theY,
Standard_Real& theZ) const
{
if(!myView.IsNull()){
// Standard_Real Xout,Yout;
// V3d_View
#ifdef IMP240100
myView->Project(P.X(),P.Y(),P.Z(),X,Y);
#else
Standard_Integer Xp,Yp;
myView->RefToPix(P.X(),P.Y(),P.Z(),Xp,Yp);
myView->Convert(Xp,Yp,X,Y);
#endif
}
else{
if(myType!=-1) {
switch (myType) {
case 0: { //-- axono standard
Standard_Real x07 = P.X()*0.7071067811865475;
Standard_Real y05 = P.Y()*0.5;
Standard_Real z05 = P.Z()*0.5;
X=x07-y05+z05;
Y=x07+y05-z05;
Z=0.7071067811865475*(P.Y()+P.Z());
Graphic3d_Vec4d aTransformed (0.0, 0.0, 0.0, 1.0);
// view transformation
switch (myType)
{
case 0 : // inverse axo
{
Standard_Real aX07 = theP.X() * 0.7071067811865475;
Standard_Real aY05 = theP.Y() * 0.5;
Standard_Real aZ05 = theP.Z() * 0.5;
aTransformed.x() = aX07 - aY05 + aZ05;
aTransformed.y() = aX07 + aY05 - aZ05;
aTransformed.z() = 0.7071067811865475 * (theP.Y() + theP.Z());
break;
}
case 1: { //-- top
X=P.X(); Y=P.Y(); Z=P.Z();
case 1 : // top
{
aTransformed.x() = theP.X();
aTransformed.y() = theP.Y();
aTransformed.z() = theP.Z();
break;
}
case 2: {
X=P.X(); Y=P.Z(); Z=-P.Y();
case 2 : // front
{
aTransformed.x() = theP.X();
aTransformed.y() = theP.Z();
aTransformed.z() = -theP.Y();
break;
}
case 3: {
Standard_Real xmy05 = (P.X()-P.Y())*0.5;
Standard_Real z07 = P.Z()*0.7071067811865476;
X=0.7071067811865476*(P.X()+P.Y());
Y=-xmy05+z07;
Z= xmy05+z07;
case 3 : // axo
{
Standard_Real aXmy05 = (theP.X() - theP.Y()) * 0.5;
Standard_Real aZ07 = theP.Z() * 0.7071067811865476;
aTransformed.x() = 0.7071067811865476 * (theP.X() + theP.Y());
aTransformed.y() = -aXmy05 + aZ07;
aTransformed.z() = aXmy05 + aZ07;
break;
}
default: {
gp_Pnt P2 = P;
Transform(P2);
P2.Coord(X,Y,Z);
break;
default :
{
gp_Pnt aTransformPnt = theP;
Transform (aTransformPnt);
aTransformed.x() = aTransformPnt.X();
aTransformed.y() = aTransformPnt.Y();
aTransformed.z() = aTransformPnt.Z();
}
}
// projection transformation
if (myPersp)
{
// simplified perspective
Standard_Real aDistortion = 1.0 - aTransformed.z() / myFocus;
theX = aTransformed.x() / aDistortion;
theY = aTransformed.y() / aDistortion;
theZ = aTransformed.z();
return;
}
else {
gp_Pnt P2 = P;
Transform(P2);
P2.Coord(X,Y,Z);
if (myPersp) {
Standard_Real R = 1 - Z / myFocus;
X = X / R;
Y = Y / R;
}
}
if (myProjTrsf.IsIdentity())
{
// no projection transformation
theX = aTransformed.x();
theY = aTransformed.y();
theZ = aTransformed.z();
return;
}
Graphic3d_Vec4d aProjected = myProjTrsf * aTransformed;
theX = aProjected.x() / aProjected.w();
theY = aProjected.y() / aProjected.w();
theZ = aProjected.z() / aProjected.w();
}
//=======================================================================
//function : Project
//purpose :
//=======================================================================
void Select3D_Projector::Project (const gp_Pnt& P,
const gp_Vec& D1,
gp_Pnt2d& Pout,
gp_Vec2d& D1out) const
void Select3D_Projector::Project (const gp_Pnt& theP,
const gp_Vec& theD1,
gp_Pnt2d& thePout,
gp_Vec2d& theD1out) const
{
gp_Pnt PP = P;
Transform(PP);
gp_Vec DD1 = D1;
Transform(DD1);
if (myPersp) {
Standard_Real R = 1. - PP.Z() / myFocus;
Pout .SetCoord(PP .X()/R , PP.Y()/R);
D1out.SetCoord(DD1.X()/R + PP.X()*DD1.Z()/(myFocus * R*R),
DD1.Y()/R + PP.Y()*DD1.Z()/(myFocus * R*R));
}
else {
Pout .SetCoord(PP .X(),PP .Y());
D1out.SetCoord(DD1.X(),DD1.Y());
}
// view transformation
gp_Pnt aTP = theP;
Transform (aTP);
gp_Vec aTD1 = theD1;
Transform (aTD1);
// projection transformation
if (myPersp)
{
// simplified perspective
Standard_Real aDist = 1.0 - aTP.Z() / myFocus;
thePout.SetCoord (aTP.X() / aDist, aTP.Y() / aDist);
theD1out.SetCoord (aTD1.X() / aDist + aTP.X() * aTD1.Z() / (myFocus * aDist * aDist),
aTD1.Y() / aDist + aTP.Y() * aTD1.Z() / (myFocus * aDist * aDist));
return;
}
if (myProjTrsf.IsIdentity())
{
// no projection transformation
thePout.SetCoord (aTP.X(), aTP.Y());
theD1out.SetCoord (aTD1.X(), aTD1.Y());
}
Graphic3d_Vec4d aTransformedPnt1 (aTP.X(), aTP.Y(), aTP.Z(), 1.0);
Graphic3d_Vec4d aTransformedPnt2 (aTP.X() + aTD1.X(), aTP.Y() + aTD1.Y(), aTP.Z() + aTD1.Z(), 1.0);
Graphic3d_Vec4d aProjectedPnt1 = myProjTrsf * aTransformedPnt1;
Graphic3d_Vec4d aProjectedPnt2 = myProjTrsf * aTransformedPnt2;
aProjectedPnt1 /= aProjectedPnt1.w();
aProjectedPnt2 /= aProjectedPnt2.w();
Graphic3d_Vec4d aProjectedD1 = aProjectedPnt2 - aProjectedPnt1;
thePout.SetCoord (aProjectedPnt1.x(), aProjectedPnt1.y());
theD1out.SetCoord (aProjectedD1.x(), aProjectedD1.y());
}
//=======================================================================
//function : Shoot
//purpose :
//=======================================================================
gp_Lin Select3D_Projector::Shoot
(const Standard_Real X,
const Standard_Real Y) const
gp_Lin Select3D_Projector::Shoot (const Standard_Real theX, const Standard_Real theY) const
{
gp_Lin L;
gp_Lin aViewLin;
if (!myView.IsNull())
if (myPersp)
{
Handle(Graphic3d_Camera) aCamera = myView->Camera();
Standard_Real aUMin, aVMin, aUMax, aVMax;
aCamera->WindowLimit (aUMin, aVMin, aUMax, aVMax);
gp_Pnt aPos = aCamera->ConvertView2World (gp_Pnt (X, Y, 1.0));
gp_Pnt aEyePos = aCamera->Eye();
gp_Dir aDir;
if (aCamera->IsOrthographic())
// simplified perspective
aViewLin = gp_Lin (gp_Pnt (0.0, 0.0, myFocus), gp_Dir (theX, theY, -myFocus));
}
else if (myProjTrsf.IsIdentity())
{
aDir = aCamera->Direction();
// no projection transformation
aViewLin = gp_Lin (gp_Pnt (theX, theY, 0.0), gp_Dir (0.0, 0.0, -1.0));
}
else
{
aDir = gp_Dir (aPos.X() - aEyePos.X(),
aPos.Y() - aEyePos.Y(),
aPos.Z() - aEyePos.Z());
}
L = gp_Lin (aPos, aDir);
}
else
// get direction of projection over the point in view space
Graphic3d_Mat4d aProjInv;
if (!myProjTrsf.Inverted (aProjInv))
{
if (myPersp) {
L = gp_Lin(gp_Pnt(0,0, myFocus),
gp_Dir(X,Y,-myFocus));
}
else {
L = gp_Lin(gp_Pnt(X,Y,0),
gp_Dir(0,0,-1));
return gp_Lin();
}
Transform(L, myInvTrsf);
Graphic3d_Vec4d aVPnt1 = aProjInv * Graphic3d_Vec4d (theX, theY, 0.0, 1.0);
Graphic3d_Vec4d aVPnt2 = aProjInv * Graphic3d_Vec4d (theX, theY, 10.0, 1.0);
aVPnt1 /= aVPnt1.w();
aVPnt2 /= aVPnt1.w();
gp_Vec aViewDir (aVPnt2.x() - aVPnt1.x(), aVPnt2.y() - aVPnt1.y(), aVPnt2.z() - aVPnt1.z());
aViewLin = gp_Lin (gp_Pnt (aVPnt1.x(), aVPnt1.y(), aVPnt1.z()), gp_Dir (aViewDir));
}
// view transformation
Transform (aViewLin, myInvTrsf);
return L;
}
void Select3D_Projector::SetView(const Handle(V3d_View)& aViou)
{
myView = aViou;
myPersp = aViou->Type()==V3d_PERSPECTIVE;
myFocus= aViou->Focale();
Standard_Real Xat,Yat,Zat,XUp,YUp,ZUp,DX,DY,DZ;
//Standard_Boolean Pers=Standard_False;
aViou->At(Xat,Yat,Zat);
aViou->Up(XUp,YUp,ZUp);
aViou->Proj(DX,DY,DZ);
gp_Pnt At (Xat,Yat,Zat);
gp_Dir Zpers (DX,DY,DZ);
gp_Dir Ypers (XUp,YUp,ZUp);
gp_Dir Xpers = Ypers.Crossed(Zpers);
gp_Ax3 Axe (At, Zpers, Xpers);
myScaledTrsf.SetTransformation(Axe);
Scaled();
return aViewLin;
}

View File

@ -14,54 +14,64 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Standard_NoSuchObject.hxx>
#include <Graphic3d_Mat4d.hxx>
#include <Standard_Assert.hxx>
#include <gp_Vec.hxx>
#include <gp_Pnt.hxx>
#include <gp_Lin.hxx>
#include <V3d_View.hxx>
#include <V3d.hxx>
//=======================================================================
//function : Perspective
//purpose :
//=======================================================================
inline Standard_Boolean Select3D_Projector::Perspective() const
{ return myPersp; }
{
return myPersp;
}
//=======================================================================
//function : ProjectionTransformation
//purpose :
//=======================================================================
inline const Graphic3d_Mat4d& Select3D_Projector::Projection() const
{
return myProjTrsf;
}
//=======================================================================
//function : Transformation
//purpose :
//=======================================================================
inline const gp_GTrsf& Select3D_Projector::Transformation() const
{ return myGTrsf; }
{
return myGTrsf;
}
//=======================================================================
//function : InvertedTransformation
//purpose :
//=======================================================================
inline const gp_GTrsf& Select3D_Projector::InvertedTransformation() const
{ return myInvTrsf; }
{
return myInvTrsf;
}
//=======================================================================
//function : FullTransformation
//purpose :
//=======================================================================
inline const gp_Trsf& Select3D_Projector::FullTransformation() const
{ return myScaledTrsf; }
{
return myScaledTrsf;
}
//=======================================================================
//function : Focus
//purpose :
//=======================================================================
inline Standard_Real Select3D_Projector::Focus() const
{
Standard_NoSuchObject_Raise_if(!myPersp,
"Select3D_Projector::Not a Perpective");
Standard_ASSERT_RAISE (myPersp, "Not a simplified Perspective.");
return myFocus;
}
@ -69,55 +79,67 @@ inline Standard_Real Select3D_Projector::Focus() const
//function : Transform
//purpose :
//=======================================================================
inline void Select3D_Projector::Transform (gp_Vec& D) const
inline void Select3D_Projector::Transform (gp_Vec& theD) const
{
gp_XYZ coord = D.XYZ();
if (myGTrsf.Form() == gp_Identity || myGTrsf.Form() == gp_Translation) { }
else if (myGTrsf.Form() == gp_PntMirror) { coord.Reverse(); }
else { coord.Multiply (myGTrsf.VectorialPart()); }
D.SetXYZ(coord);
gp_XYZ aXYZ = theD.XYZ();
if (myGTrsf.Form() == gp_PntMirror)
{
aXYZ.Reverse();
}
else if (myGTrsf.Form() != gp_Identity && myGTrsf.Form() != gp_Translation)
{
aXYZ.Multiply (myGTrsf.VectorialPart());
}
theD.SetXYZ (aXYZ);
}
//=======================================================================
//function : Transform
//purpose :
//=======================================================================
inline void Select3D_Projector::Transform (gp_Pnt& Pnt) const
inline void Select3D_Projector::Transform (gp_Pnt& thePnt) const
{
gp_XYZ xyz = Pnt.XYZ();
myGTrsf.Transforms(xyz);
Pnt = gp_Pnt(xyz);
Transform (thePnt, myGTrsf);
}
inline const Handle(V3d_View)& Select3D_Projector::View() const
{return myView;}
inline void Select3D_Projector::Transform (gp_Lin& Lin, const gp_GTrsf& T) const
//=======================================================================
//function : Transform
//purpose :
//=======================================================================
inline void Select3D_Projector::Transform (gp_Lin& theLin, const gp_GTrsf& theTrsf) const
{
gp_Ax1 ax1 = Lin.Position();
gp_XYZ xyz = ax1.Location().XYZ();
T.Transforms(xyz);
ax1.SetLocation(gp_Pnt(xyz));
gp_Dir dir = ax1.Direction();
gp_XYZ coord = dir.XYZ();
if (T.Form() == gp_Identity || T.Form() == gp_Translation) { }
else if (T.Form() == gp_PntMirror) { coord.Reverse(); }
else {
coord.Multiply (T.VectorialPart());
Standard_Real D = coord.Modulus();
coord.Divide(D);
gp_Ax1 anAx1 = theLin.Position();
gp_XYZ aXYZ = anAx1.Location().XYZ();
theTrsf.Transforms (aXYZ);
anAx1.SetLocation (gp_Pnt (aXYZ));
gp_Dir aDir = anAx1.Direction();
gp_XYZ aDirXYZ = aDir.XYZ();
if (theTrsf.Form() == gp_PntMirror)
{
aDirXYZ.Reverse();
}
dir.SetXYZ(coord);
ax1.SetDirection(dir);
Lin.SetPosition(ax1);
else if (theTrsf.Form() != gp_Identity && theTrsf.Form() != gp_Translation)
{
aDirXYZ.Multiply (theTrsf.VectorialPart());
Standard_Real aModulus = aDirXYZ.Modulus();
aDirXYZ.Divide (aModulus);
}
inline void Select3D_Projector::Transform (gp_Pnt& Pnt, const gp_GTrsf& T) const
{
gp_XYZ xyz = Pnt.XYZ();
T.Transforms(xyz);
Pnt = gp_Pnt(xyz);
aDir.SetXYZ (aDirXYZ);
anAx1.SetDirection (aDir);
theLin.SetPosition (anAx1);
}
//=======================================================================
//function : Transform
//purpose :
//=======================================================================
inline void Select3D_Projector::Transform (gp_Pnt& thePnt, const gp_GTrsf& theTrsf) const
{
gp_XYZ aXYZ = thePnt.XYZ();
theTrsf.Transforms (aXYZ);
thePnt = gp_Pnt (aXYZ);
}

View File

@ -16,12 +16,9 @@
-- Modified by rob jun 25 98 : Add Method : Reactivate projector...
class ViewerSelector3d from StdSelect inherits ViewerSelector from SelectMgr
---Purpose: Selector Usable by Viewers from V3d
--
uses
View from V3d,
@ -34,28 +31,30 @@ uses
Array1OfReal from TColStd,
Array1OfPnt2d from TColgp,
SensitivityMode from StdSelect,
Lin from gp
Lin from gp,
Pnt from gp,
Dir from gp,
XYZ from gp
is
Create returns mutable ViewerSelector3d from StdSelect;
---Purpose: Constructs an empty 3D selector object.
Create(aProj : Projector from Select3D) returns mutable ViewerSelector3d from StdSelect;
---Purpose: Constructs a 3D selector object defined by the projector aProj.
Convert(me:mutable;aSelection:mutable Selection from SelectMgr)
Create (theProj : Projector from Select3D) returns mutable ViewerSelector3d from StdSelect;
---Purpose: Constructs a 3D selector object defined by the projector <theProj>.
Convert (me : mutable; theSel : mutable Selection from SelectMgr)
is redefined static;
---Level: Public
---Purpose: Processes the projection of the sensitive primitives
-- in the active view ; to be done before the selection action...
Set(me:mutable; aProj: Projector from Select3D) is static;
---Purpose: Sets the new projector aProj to replace the one used at construction time.
Set (me : mutable; theProj : Projector from Select3D) is static;
---Purpose: Sets the new projector <theProj> to replace the one used at construction time.
SetSensitivityMode (me : mutable;
aMode : SensitivityMode from StdSelect) is static;
theMode : SensitivityMode from StdSelect) is static;
---Purpose: Sets the selection sensitivity mode. SM_WINDOW mode
-- uses the specified pixel tolerance to compute the sensitivity
-- value, SM_VIEW mode allows to define the sensitivity manually.
@ -65,33 +64,28 @@ is
---Purpose: Returns the selection sensitivity mode.
SetPixelTolerance (me : mutable;
aTolerance : Integer) is static;
---Purpose: Sets the pixel tolerance aTolerance.
theTolerance : Integer) is static;
---Purpose: Sets the pixel tolerance <theTolerance>.
PixelTolerance (me) returns Integer from Standard;
---C++: inline
---Purpose: Returns the pixel tolerance.
Pick (me : mutable;XPix,YPix:Integer;
aView : View from V3d) is static;
Pick (me : mutable; theXPix, theYPix : Integer;
theView : View from V3d) is static;
---Level: Public
---Purpose: Picks the sensitive entity at the pixel coordinates of
-- the mouse Xpix and Ypix. The selector looks for touched areas and owners.
-- the mouse <theXPix> and <theYPix>. The selector looks for touched areas and owners.
Pick (me:mutable;XPMin,YPMin,XPMax,YPMax:Integer;aView:View from V3d) is static;
Pick (me : mutable; theXPMin, theYPMin, theXPMax, theYPMax : Integer; theView : View from V3d) is static;
---Purpose: Picks the sensitive entity according to the minimum
-- and maximum pixel values XPMin, YPMin, XPMax
-- and YPMax defining a 2D area for selection in the 3D view aView.
-- and maximum pixel values <theXPMin>, <theYPMin>, <theXPMax>
-- and <theYPMax> defining a 2D area for selection in the 3D view aView.
Pick (me:mutable;Polyline:Array1OfPnt2d from TColgp;aView:View from V3d) is static;
Pick (me : mutable; thePolyline : Array1OfPnt2d from TColgp; theView : View from V3d) is static;
---Level: Public
---Purpose: pick action - input pixel values for polyline selection for selection.
---Category: Inquire Methods
Projector (me) returns Projector from Select3D;
@ -100,51 +94,43 @@ is
---C++: inline
---C++: return const&
---Category: Internal Methods
-- -----------------
UpdateProj (me : mutable;
aView: View from V3d) returns Boolean is static private;
theView : View from V3d) returns Boolean is static private;
---Level: Internal
DisplayAreas (me : mutable;
aView: View from V3d) is static;
---Purpose: Displays sensitive areas found in the view aView.
theView : View from V3d) is static;
---Purpose: Displays sensitive areas found in the view <theView>.
ClearAreas (me : mutable;
aView: View from V3d) is static;
theView : View from V3d) is static;
---Purpose: Clears the view aView of sensitive areas found in it.
DisplaySensitive(me:mutable;aView : View from V3d) is static;
--- Purpose: Displays the selection aSel found in the view aView.
ClearSensitive(me:mutable;aView:View from V3d) is static;
DisplaySensitive (me : mutable; theView : View from V3d) is static;
--- Purpose: Displays sensitives in view <theView>.
ClearSensitive (me : mutable; theView : View from V3d) is static;
DisplaySensitive (me : mutable;
aSel : Selection from SelectMgr;
aView : View from V3d;
ClearOthers : Boolean from Standard = Standard_True)
theSel : Selection from SelectMgr;
theView : View from V3d;
theToClearOthers : Boolean from Standard = Standard_True)
is static;
DisplayAreas (me : mutable;
aSel :Selection from SelectMgr;
aView : View from V3d;
ClearOthers : Boolean from Standard = Standard_True)
theSel : Selection from SelectMgr;
theView : View from V3d;
theToClearOthers : Boolean from Standard = Standard_True)
is static;
ComputeSensitivePrs(me:mutable;aSel: Selection from SelectMgr)
ComputeSensitivePrs (me : mutable; theSel: Selection from SelectMgr)
is static private;
---Level: Internal
ComputeAreasPrs(me:mutable;aSel:Selection from SelectMgr)
ComputeAreasPrs (me : mutable; theSel : Selection from SelectMgr)
is static private;
---Level: Internal
@ -190,16 +176,17 @@ is
fields
myprj : Projector from Select3D;
mycoeff : Real from Standard[14];
myprevcoeff : Real from Standard[14];
mycenter : Real from Standard[2];
myprevcenter : Real from Standard[2];
mylastzoom : Real from Standard;
mysensmode : SensitivityMode from StdSelect;
mypixtol : Integer ;
myupdatetol : Boolean;
myProjector : Projector from Select3D;
myPrevAt : Real from Standard[3];
myPrevUp : Real from Standard[3];
myPrevProj : Real from Standard[3];
myPrevAxialScale : Real from Standard[3];
myPrevFOV : Real from Standard;
myPrevScale : Real from Standard;
myPrevOrthographic : Boolean from Standard;
mySensMode : SensitivityMode from StdSelect;
myPixelTolerance : Integer from Standard;
myToUpdateTolerance : Boolean from Standard;
--areas verification...

File diff suppressed because it is too large Load Diff

View File

@ -14,15 +14,15 @@
inline StdSelect_SensitivityMode StdSelect_ViewerSelector3d::SensitivityMode() const
{
return mysensmode;
return mySensMode;
}
inline Standard_Integer StdSelect_ViewerSelector3d::PixelTolerance() const
{
return mypixtol;
return myPixelTolerance;
}
inline const Handle(Select3D_Projector)& StdSelect_ViewerSelector3d::Projector() const
{
return myprj;
return myProjector;
}

View File

@ -135,7 +135,8 @@ uses
ExtendedString from TCollection,
PrintAlgo from Aspect,
ClipPlane_Handle from Graphic3d,
SequenceOfHClipPlane from Graphic3d
SequenceOfHClipPlane from Graphic3d,
XYZ from gp
raises
BadValue from V3d, TypeMismatch from Standard,
@ -403,14 +404,27 @@ is
returns Boolean from Standard;
---Purpose: sets the immediate update mode and returns the previous one.
SetAutoZFitMode( me : mutable; theMode : Boolean );
SetAutoZFitMode (me : mutable;
theIsOn : Boolean;
theScaleFactor : Real from Standard = 1.0);
---Level: public
---Purpose: sets the auto z-fit mode
---Purpose: Sets the automatic z-fit mode and its parameters.
-- The auto z-fit has extra parameters which can controlled from application level
-- to ensure that the size of viewing volume will be sufficiently large to cover
-- the depth of unmanaged objects, for example, transformation persistent ones.
-- @param theScaleFactor [in] the scale factor for Z-range.
-- The range between Z-min, Z-max projection volume planes
-- evaluated by z fitting method will be scaled using this coefficient.
-- Program error exception is thrown if negative or zero value
-- is passed.
AutoZFitMode (me) returns Boolean;
---Level: public
---Purpose: returns current auto z-fit mode
---Purpose: returns TRUE if automatic z-fit mode is turned on.
AutoZFitScaleFactor (me) returns Real from Standard;
---Level: public
---Purpose: returns scale factor parameter of automatic z-fit mode.
---------------------------------------------------
-- Triedron methods
@ -704,8 +718,10 @@ is
-- the current axis a distance relative to the initial
-- position expressed by Start = Standard_True
Place (me: mutable; x,y: Integer from Standard;
aZoomFactor: Factor from Quantity = 1)
Place (me : mutable;
theXp : Integer from Standard;
theYp : Integer from Standard;
theZoomFactor : Factor from Quantity = 1)
---Level: Public
---Purpose: places the point of the view corresponding
-- at the pixel position x,y at the center of the window
@ -807,25 +823,32 @@ is
---Category: Methods to modify the Mapping of the view
--------------------------------------------------------
Panning ( me : mutable ; Dx , Dy : Length ;
aZoomFactor : Factor from Quantity = 1;
Start : Boolean = Standard_True )
Panning (me : mutable;
theDXv : Real from Standard;
theDYv : Real from Standard;
theZoomFactor : Factor from Quantity = 1;
theToStart : Boolean = Standard_True);
---Level: Public
---Purpose: translates the center of the view and zooms the view.
-- Updates the view.
raises BadValue from V3d ;
---Purpose: Translates the center of the view along "x" and "y" axes of
-- view projection. Can be used to perform interactive panning operation.
-- In that case the DXv, DXy parameters specify panning relative to the
-- point where the operation is started.
-- @param theDXv [in] the relative panning on "x" axis of view projection, in view space coordinates.
-- @param theDYv [in] the relative panning on "y" axis of view projection, in view space coordinates.
-- @param theZoomFactor [in] the zooming factor.
-- @param theToStart [in] pass TRUE when starting panning to remember view
-- state prior to panning for relative arguments. If panning is started,
-- passing {0, 0} for {theDXv, theDYv} will return view to initial state.
-- Performs update of view.
SetCenter ( me : mutable ; Xc , Yc : Coordinate )
SetCenter (me : mutable; theXp, theYp : Integer from Standard)
---Level: Public
---Purpose: Defines the centre of the view.
-- Updates the view.
raises BadValue from V3d ;
-- If one of the dimensions of the projection is NULL.
SetCenter ( me : mutable ; X,Y: Integer from Standard)
---Level: Public
---Purpose: Defines the centre of the view from a pixel position.
-- Updates the view.
---Purpose: Relocates center of screen to the point, determined by
-- {Xp, Yp} pixel coordinates relative to the bottom-left corner of
-- screen. To calculate pixel coordinates for any point from world
-- coordinate space, it can be projected using "Project".
-- @param theXp [in] the x coordinate.
-- @param theYp [in] the y coordinate.
raises BadValue from V3d;
-- If one of the dimensions of the projection is NULL.
@ -878,29 +901,34 @@ is
raises BadValue from V3d ;
-- If the one of factors <= 0
FitAll ( me : mutable ; Coef : Coefficient = 0.01; update : Boolean from Standard = Standard_True )
FitAll (me : mutable;
theMargin : Coefficient = 0.01;
theToUpdate : Boolean from Standard = Standard_True);
---Level: Public
---Purpose: Automatic zoom/panning. Objects in the view are visualised
-- so as to occupy the maximum space while respecting the
-- margin coefficient and the initial height /width ratio.
-- Fits Z depending on AutoZFit option.
raises BadValue from V3d ;
-- If the margin coefficient is <0 ou >= 1 or
-- Updates the view
---Purpose: Adjust view parameters to fit the displayed scene, respecting height / width ratio.
-- The Z clipping range (depth range) is fitted if AutoZFit flag is TRUE.
-- Throws program error exception if margin coefficient is < 0 or >= 1.
-- Updates the view.
-- @param theMargin [in] the margin coefficient for view borders.
-- @param theToUpdate [in] flag to perform view update.
ZFitAll ( me : mutable ; Coef : Coefficient = 1.0 )
ZFitAll (me : mutable; theScaleFactor : Real from Standard = 1.0);
---Level: Public
---Purpose: Automatic Depth Panning. Objects visible in the view are
-- visualised so as to occupy the maximum Z amount of space
-- while respecting the margin coefficient .
-- NOTE than the original XY size of the view is NOT modified .
raises BadValue from V3d ;
-- If the margin coefficient is <0 ou or
-- If No Objects are displayed in the view
---Purpose: Change Z-min and Z-max planes of projection volume to match the
-- displayed objects. The methods ensures that view volume will
-- be close by depth range to the displayed objects. Fitting assumes that
-- for orthogonal projection the view volume contains the displayed objects
-- completely. For zoomed perspective view, the view volume is adjusted such
-- that it contains the objects or their parts, located in front of the camera.
-- @param theScaleFactor [in] the scale factor for Z-range.
-- The range between Z-min, Z-max projection volume planes
-- evaluated by z fitting method will be scaled using this coefficient.
-- Program error exception is thrown if negative or zero value is passed.
AutoZFit (me : mutable);
---Level: Public
---Purpose: Automatic z-range fitting with ZFitAll. Works only if myAutoZFit enabled.
---Purpose: If automatic z-range fitting is turned on, adjusts Z-min and Z-max
-- projection volume planes with call to ZFitAll.
DepthFitAll( me : mutable ; Aspect : Coefficient = 0.01;
Margin : Coefficient = 0.01 );
@ -910,36 +938,29 @@ is
-- calculated Z size and Aspect parameter.
-- NOTE than the original XY size of the view is NOT modified .
FitAll ( me : mutable ; Umin, Vmin, Umax, Vmax : Coordinate )
FitAll (me : mutable;
theMinXv : Real from Standard;
theMinYv : Real from Standard;
theMaxXv : Real from Standard;
theMaxYv : Real from Standard)
---Level: Public
---Purpose: Centres the defined projection window so that it occupies
---Purpose: Centers the defined projection window so that it occupies
-- the maximum space while respecting the initial
-- height/width ratio.
-- NOTE than the original Z size of the view is NOT modified .
raises BadValue from V3d;
-- If the defined projection window has zero size.
WindowFit ( me : mutable ; Xmin, Ymin, Xmax, Ymax : Integer)
WindowFit (me : mutable; theMinXp, theMinYp, theMaxXp, theMaxYp : Integer)
---Level: Public
---Purpose: Centres the defined PIXEL window so that it occupies
-- the maximum space while respecting the initial
-- height/width ratio.
---Purpose: Centers the defined PIXEL window so that it occupies
-- the maximum space while respecting the initial height/width ratio.
-- NOTE than the original Z size of the view is NOT modified.
raises BadValue from V3d
-- If the defined projection window has zero size.
-- @param theMinXp [in] pixel coordinates of minimal corner on x screen axis.
-- @param theMinYp [in] pixel coordinates of minimal corner on y screen axis.
-- @param theMaxXp [in] pixel coordinates of maximal corner on x screen axis.
-- @param theMaxYp [in] pixel coordinates of maximal corner on y screen axis.
is static;
SetViewingVolume ( me : mutable ; Left, Right, Bottom, Top, ZNear, ZFar : Real from Standard)
---Level: Public
---Purpose: Sets Z and XY size of the view according to given values
-- with respecting the initial view depth (eye position).
-- Width/heigth aspect ratio should be preserved by the caller
-- of this method similarly to SetSize() to avoid unexpected
-- visual results like non-uniform scaling of objects in the view.
raises BadValue from V3d;
-- If the ZNear<0, ZFar<0 or ZNear>=Zfar.
SetViewMappingDefault( me : mutable );
---Level: Public
---Purpose: Saves the current view mapping. This will be the
@ -947,12 +968,12 @@ is
ResetViewMapping ( me : mutable );
---Level: Public
---Purpose: Resets the centring of the view.
---Purpose: Resets the centering of the view.
-- Updates the view
Reset ( me : mutable; update : Boolean from Standard = Standard_True );
---Level: Public
---Purpose: Resets the centring and the orientation of the view
---Purpose: Resets the centering and the orientation of the view
-- Updates the view
---------------------------------------------------
---Category: Inquire methods
@ -1085,10 +1106,6 @@ is
---Level: Public
---Purpose: Returns the current values of the anisotropic (axial) scale factors.
Center ( me; Xc,Yc : out Coordinate );
---Level: Public
---Purpose: Returns the centre of the view.
Size ( me; Width, Height : out Length );
---Level: Public
---Purpose: Returns the height and width of the view.
@ -1214,31 +1231,51 @@ is
---Level: Public
---Purpose: Returns the Type of the View
Pan ( me : mutable; Dx, Dy: Integer from Standard;
aZoomFactor: Factor from Quantity = 1);
Pan (me : mutable;
theDXp : Integer from Standard;
theDYp : Integer from Standard;
theZoomFactor : Factor from Quantity = 1;
theToStart : Boolean = Standard_True);
---Level: Public
---Purpose: translates the center of the view and zooms the view.
-- and updates the view.
---Purpose: Translates the center of the view along "x" and "y" axes of
-- view projection. Can be used to perform interactive panning operation.
-- In that case the DXp, DXp parameters specify panning relative to the
-- point where the operation is started.
-- @param theDXp [in] the relative panning on "x" axis of view projection, in pixels.
-- @param theDYp [in] the relative panning on "y" axis of view projection, in pixels.
-- @param theZoomFactor [in] the zooming factor.
-- @param theToStart [in] pass TRUE when starting panning to remember view
-- state prior to panning for relative arguments. Passing 0 for relative
-- panning parameter should return view panning to initial state.
-- Performs update of view.
Zoom ( me : mutable; X1 , Y1 , X2 , Y2 : Integer from Standard)
Zoom (me : mutable;
theXp1 : Integer from Standard;
theYp1 : Integer from Standard;
theXp2 : Integer from Standard;
theYp2 : Integer from Standard)
is static;
---Level: Public
---Purpose: Zoom the view according to a zoom factor computed
-- from the distance between the 2 mouse position <X1,Y1>,<X2,Y2>
Zoom ( me: mutable; X,Y: Integer from Standard)
is static;
---Level: Public
---Purpose: Zoom the view according to a zoom factor computed
-- from the distance between the last and new mouse position <X,Y>
-- from the distance between the 2 mouse position.
-- @param theXp1 [in] the x coordinate of first mouse position, in pixels.
-- @param theYp1 [in] the y coordinate of first mouse position, in pixels.
-- @param theXp2 [in] the x coordinate of second mouse position, in pixels.
-- @param theYp2 [in] the y coordinate of second mouse position, in pixels.
StartZoomAtPoint (me : mutable;
xpix, ypix : Integer from Standard);
theXp : Integer from Standard;
theYp : Integer from Standard);
---Level: Public
---Purpose: Defines the point (pixel) of zooming (for the method ZoomAtPoint()).
---Purpose: Defines starting point for ZoomAtPoint view operation.
-- @param theXp [in] the x mouse coordinate, in pixels.
-- @param theYp [in] the y mouse coordinate, in pixels.
ZoomAtPoint(me : mutable;
mouseStartX, mouseStartY, mouseEndX, mouseEndY : Integer from Standard);
theMouseStartX : Integer from Standard;
theMouseStartY : Integer from Standard;
theMouseEndX : Integer from Standard;
theMouseEndY : Integer from Standard);
---Level: Public
---Purpose: Zooms the model at a pixel defined by the method StartZoomAtPoint().
@ -1252,13 +1289,13 @@ is
StartRotation(me : mutable ; X,Y :Integer from Standard;
zRotationThreshold: Ratio from Quantity = 0.0);
---Level: Public
---Purpose: Begin the rotation of the view arround the screen axis
---Purpose: Begin the rotation of the view around the screen axis
-- according to the mouse position <X,Y>.
-- Warning: Enable rotation around the Z screen axis when <zRotationThreshold>
-- factor is > 0 soon the distance from the start point and the center
-- of the view is > (medium viewSize * <zRotationThreshold> ).
-- Generally a value of 0.4 is usable to rotate around XY screen axis
-- inside the circular treshold area and to rotate around Z screen axis
-- inside the circular threshold area and to rotate around Z screen axis
-- outside this area.
Rotation(me:mutable; X,Y :Integer from Standard);
@ -1469,18 +1506,20 @@ is
theWidth : Integer from Standard;
theHeight : Integer from Standard;
theBufferType : BufferType from Graphic3d = Graphic3d_BT_RGB;
theForceCentered : Boolean from Standard = Standard_True;
theToKeepAspect : Boolean from Standard = Standard_True;
theStereoOptions : StereoDumpOptions from V3d = V3d_SDO_MONO)
returns Boolean from Standard;
---Level : Public
---Purpose : dump the full contents of the view
---Purpose : Dumps the full contents of the view
-- to a pixmap of pixel size <theWidth> * <theHeight> and
-- buffer type <theBufferType>. If <theForceCentered> is true
-- view scene will be centered.
-- buffer type <theBufferType>. If <theToKeepAspect> is true
-- the aspect ratio of view will be kept if <theWidth> and <theHeight>
-- define another ratio.
-- Pixmap will be automatically (re)allocated when needed.
-- For stereographic camera by default the monographic projection
-- is used during dumping. <theStereoOptions> flag can be used to
-- dump projection for left right eye.
-- When dumping stereographic camera - the corresponding
-- middle-point monographic projection will be used for dumping by default.
-- <theStereoOptions> flags are to be used for dumping then left or
-- right eye projections.
SetProjModel( me : mutable;
amOdel: TypeOfProjectionModel from V3d = V3d_TPM_SCREEN )
@ -1539,7 +1578,7 @@ is
---Purpose: Adds clip plane to the view. The composition of clip planes truncates the
-- rendering space to convex volume. Number of supported clip planes can be consulted
-- by PlaneLimit method of associated Visual3d_View. Please be aware that the planes
-- which exceed the limit are igonred during rendering.
-- which exceed the limit are ignored during rendering.
-- @param thePlane [in] the clip plane to be added to view.
RemoveClipPlane (me : mutable; thePlane : ClipPlane_Handle from Graphic3d) is virtual;
@ -1552,7 +1591,7 @@ is
-- truncates the rendering space to convex volume. Number of supported
-- clip planes can be consulted by PlaneLimit method of associated
-- Visual3d_View. Please be aware that the planes which exceed the limit
-- are igonred during rendering.
-- are ignored during rendering.
-- @param thePlanes [in] the clip planes to set.
GetClipPlanes (me) returns SequenceOfHClipPlane from Graphic3d;
@ -1566,48 +1605,57 @@ is
Camera (me) returns Camera_Handle from Graphic3d is static;
---Level: Public
---C++: return const&
---Purpose: Returns camera object of the view.
-- @return: handle to camera object, or NULL if 3D view does not use
-- the camera approach.
FitCamera (me : mutable;
theXmin : Real from Standard;
theYmin : Real from Standard;
theZmin : Real from Standard;
theXmax : Real from Standard;
theYmax : Real from Standard;
theZmax : Real from Standard) is protected;
FitMinMax (me;
theCamera : Camera_Handle from Graphic3d;
theMinCorner : XYZ from gp;
theMaxCorner : XYZ from gp;
theMargin : Real from Standard;
theResolution : Real from Standard = 0.0;
theToEnlargeIfLine : Boolean from Standard = Standard_True)
returns Boolean from Standard is protected;
---Level: Protected
---Purpose: Transform camera to fit in the passed bounding box
-- specified in world coordinate space.
-- @param theXmin [in] x min bounding.
-- @param theYmin [in] y min bounding.
-- @param theZmin [in] z min bounding.
-- @param theXmax [in] x max bounding.
-- @param theYmax [in] y max bounding.
-- @param theZmax [in] z max bounding.
---Purpose: Transform camera eye, center and scale to fit in the
-- passed bounding box specified in WCS.
-- @param theCamera [in] the camera.
-- @param theMinCorner [in] the minimal corner of bounding box.
-- @param theMaxCorner [in] the maximal corner of bounding box.
-- @param theMargin [in] the margin coefficient for view borders.
-- @param theResolution [in] the minimum size of projection of
-- bounding box in Xv or Yv direction when it considered to
-- be a thin plane or point (without a volume).
-- In this case only the center of camera is adjusted.
-- @param theToEnlargeIfLine [in] if passed TRUE - in cases when the
-- whole bounding box projected into thin line going along
-- Z-axis of screen, the view plane is enlarged such that
-- we see the whole line on rotation, otherwise only the
-- center of camera is adjusted.
-- @return TRUE if the fit all operation can be done.
ZoomCamera (me : mutable;
theUSize : Real from Standard;
theVSize : Real from Standard;
theZDepth : Real from Standard = 0.0) is protected;
Scale (me;
theCamera : Camera_Handle from Graphic3d;
theSizeXv : Real from Standard;
theSizeYv : Real from Standard) is protected;
---Level: Protected
---Purpose: Zoom camera to fit the section defined in view coordinate space
-- lying on the view direction ray. For orthogonal camera the method
-- changes scale, for perspective adjusts Eye location about the Center point.
-- Depth by Z defines distance of the zoomed section from camera Center.
-- It is optional and for orthographic camera has no effect.
-- @param theUSize [in] size of view section on U axis (horizontal to the screen).
-- @param theVSize [in] size of view section on V axis (vertical to the screen).
-- @param theZDepth [in] distance from camera center to the specified section.
---Purpose: Scales camera to fit the view frame of defined width and height
-- keeping the aspect. For orthogonal camera the method changes scale,
-- for perspective adjusts Eye location about the Center point.
-- @param theSizeXv [in] size of viewport frame on "x" axis.
-- @param theSizeYv [in] size of viewport frame on "y" axis.
PanCamera (me : mutable;
theU : Real from Standard;
theV : Real from Standard) is protected;
Translate (me;
theCamera : Camera_Handle from Graphic3d;
theDXv : Real from Standard;
theDYv : Real from Standard) is protected;
---Level: Protected
---Purpose: Pan camera along the view plane on the passed U, V distances.
-- @param theU [in] the horizontal panning.
-- @param theV [in] the vertical panning.
-- Purpose: Translates camera eye and center along the view plane.
-- @param theCamera [in] the camera to translate.
-- @param theDXv [in] the translation in "x" direction.
-- @param theDYv [in] the translation in "y" direction.
SetRaytracingMode (me : mutable) is static;
---Level: Public
@ -1699,7 +1747,8 @@ fields
myViewAxis : Vector from Graphic3d;
myGravityReferencePoint : Vertex from Graphic3d;
myCamProjectionShift : Pnt from gp;
myAutoZFitMode: Boolean from Standard;
myAutoZFitIsOn : Boolean from Standard;
myAutoZFitScaleFactor : Real from Standard;
friends

File diff suppressed because it is too large Load Diff

View File

@ -161,13 +161,22 @@ void V3d_View::Translate(const V3d_TypeOfAxe Axe, const Standard_Real Length,con
break ;
}
}
void V3d_View::Place (const Standard_Integer ix, const Standard_Integer iy,
const Quantity_Factor aZoomFactor) {
Standard_Real xpos, ypos;
Standard_Integer xc, yc;
Center (xpos, ypos);
Convert (xpos, ypos, xc, yc);
Pan (xc - ix, iy - yc, aZoomFactor / Scale());
//=======================================================================
//function : Place
//purpose :
//=======================================================================
void V3d_View::Place (const Standard_Integer theXp,
const Standard_Integer theYp,
const Quantity_Factor theZoomFactor)
{
Standard_Integer aWinWidth = 0;
Standard_Integer aWinHeight = 0;
View()->Window()->Size (aWinWidth, aWinHeight);
Standard_Integer aWinCXp = aWinWidth / 2;
Standard_Integer aWinCYp = aWinHeight / 2;
Pan (aWinCXp - theXp, aWinCYp - theYp, theZoomFactor / Scale());
}
void V3d_View::Translate(const Standard_Real theLength, const Standard_Boolean theStart) {

View File

@ -197,5 +197,4 @@ is
---Purpose: Splits "parameter=value" string into separate
-- parameter and value strings.
-- @return TRUE if the string matches pattern "<string>=<empty or string>"
end;

View File

@ -28,6 +28,7 @@
#include <TopLoc_Location.hxx>
#include <TopTools_HArray1OfShape.hxx>
#include <TColStd_HArray1OfTransient.hxx>
#include <TColStd_SequenceOfAsciiString.hxx>
#include <OSD_Timer.hxx>
#include <Geom_Axis2Placement.hxx>
#include <Geom_Axis1Placement.hxx>
@ -87,7 +88,6 @@ extern int ViewerMainLoop(Standard_Integer argc, const char** argv);
#define DEFAULT_COLOR Quantity_NOC_GOLDENROD
#define DEFAULT_MATERIAL Graphic3d_NOM_BRASS
//=======================================================================
//function : GetColorFromName
//purpose : get the Quantity_NameOfColor from a string
@ -3784,7 +3784,7 @@ static Standard_Integer TDraft(Draw_Interpretor& di, Standard_Integer argc, cons
//==============================================================================
//function : splitParameter
//purpose : Split parameter string to parameter name an parameter value
//purpose : Split parameter string to parameter name and parameter value
//==============================================================================
Standard_Boolean ViewerTest::SplitParameter (const TCollection_AsciiString& theString,
TCollection_AsciiString& theName,

View File

@ -58,9 +58,11 @@
#include <Image_AlienPixMap.hxx>
#include <OpenGl_GraphicDriver.hxx>
#include <OSD_Timer.hxx>
#include <TColStd_SequenceOfAsciiString.hxx>
#include <TColStd_SequenceOfInteger.hxx>
#include <TColStd_HSequenceOfReal.hxx>
#include <TColgp_Array1OfPnt2d.hxx>
#include <TColStd_MapOfAsciiString.hxx>
#include <Visual3d_LayerItem.hxx>
#include <Aspect_TypeOfLine.hxx>
#include <Image_Diff.hxx>
@ -1670,12 +1672,12 @@ static void ProcessControlButton1Motion()
//==============================================================================
void VT_ProcessControlButton2Motion()
{
Quantity_Length dx = ViewerTest::CurrentView()->Convert(X_Motion - X_ButtonPress);
Quantity_Length dy = ViewerTest::CurrentView()->Convert(Y_Motion - Y_ButtonPress);
Standard_Integer aDx = X_Motion - X_ButtonPress;
Standard_Integer aDy = Y_Motion - Y_ButtonPress;
dy = -dy; // Xwindow Y axis is from top to Bottom
aDy = -aDy; // Xwindow Y axis is from top to Bottom
ViewerTest::CurrentView()->Panning( dx, dy );
ViewerTest::CurrentView()->Pan (aDx, aDy);
X_ButtonPress = X_Motion;
Y_ButtonPress = Y_Motion;
@ -2457,20 +2459,46 @@ static int VFit(Draw_Interpretor& , Standard_Integer , const char** )
//purpose : ZFitall, no DRAW arguments
//Draw arg : No args
//==============================================================================
static int VZFit(Draw_Interpretor& , Standard_Integer , const char** )
static int VZFit (Draw_Interpretor& /*theDi*/, Standard_Integer theArgsNb, const char** theArgVec)
{
Handle(V3d_View) V = ViewerTest::CurrentView();
if ( !V.IsNull() ) V->ZFitAll(); return 0; }
const Handle(V3d_View)& aCurrentView = ViewerTest::CurrentView();
if (aCurrentView.IsNull())
{
std::cout << theArgVec[0] << ": Call vinit before this command, please.\n";
return 1;
}
if (theArgsNb == 1)
{
aCurrentView->ZFitAll();
aCurrentView->Redraw();
return 0;
}
Standard_Real aScale = 1.0;
if (theArgsNb >= 2)
{
aScale = Draw::Atoi (theArgVec[1]);
}
aCurrentView->ZFitAll (aScale);
aCurrentView->Redraw();
return 0;
}
//==============================================================================
//function : VRepaint
//purpose :
//==============================================================================
static int VRepaint (Draw_Interpretor& , Standard_Integer , const char** )
{
Handle(V3d_View) V = ViewerTest::CurrentView();
if ( !V.IsNull() ) V->Redraw(); return 0;
}
//==============================================================================
//function : VClear
//purpose : Remove all the object from the viewer
@ -4342,70 +4370,181 @@ static Standard_Integer VMoveTo (Draw_Interpretor& di,
return 0;
}
//=======================================================================
//=================================================================================================
//function : VViewParams
//purpose : Gets or sets AIS View characteristics
//=======================================================================
static Standard_Integer VViewParams (Draw_Interpretor& di,
Standard_Integer argc,
const char ** argv)
//=================================================================================================
static int VViewParams (Draw_Interpretor& theDi, Standard_Integer theArgsNb, const char** theArgVec)
{
if ( argc != 1 && argc != 13)
{
di << "Usage : " << argv[0] << "\n";
return 1;
}
Handle(V3d_View) anAISView = ViewerTest::CurrentView();
if (anAISView.IsNull())
{
di << "use 'vinit' command before " << argv[0] << "\n";
std::cout << theArgVec[0] << ": please initialize or activate view.\n";
return 1;
}
if(argc==1){
Quantity_Factor anAISViewScale = anAISView -> V3d_View::Scale ();
Standard_Real anAISViewCenterCoordinateX = 0.0;
Standard_Real anAISViewCenterCoordinateY = 0.0;
anAISView -> V3d_View::Center (anAISViewCenterCoordinateX, anAISViewCenterCoordinateY);
if (theArgsNb == 1)
{
// print all of the available view parameters
Quantity_Factor anAISViewScale = anAISView->Scale();
Standard_Real anAISViewProjX = 0.0;
Standard_Real anAISViewProjY = 0.0;
Standard_Real anAISViewProjZ = 0.0;
anAISView -> V3d_View::Proj (anAISViewProjX, anAISViewProjY, anAISViewProjZ);
anAISView->Proj (anAISViewProjX, anAISViewProjY, anAISViewProjZ);
Standard_Real anAISViewUpX = 0.0;
Standard_Real anAISViewUpY = 0.0;
Standard_Real anAISViewUpZ = 0.0;
anAISView -> V3d_View::Up (anAISViewUpX, anAISViewUpY, anAISViewUpZ);
anAISView->Up (anAISViewUpX, anAISViewUpY, anAISViewUpZ);
Standard_Real anAISViewAtX = 0.0;
Standard_Real anAISViewAtY = 0.0;
Standard_Real anAISViewAtZ = 0.0;
anAISView -> V3d_View::At (anAISViewAtX, anAISViewAtY, anAISViewAtZ);
di << "Scale of current view: " << anAISViewScale << "\n";
di << "Center on X : "<< anAISViewCenterCoordinateX << "; on Y: " << anAISViewCenterCoordinateY << "\n";
di << "Proj on X : " << anAISViewProjX << "; on Y: " << anAISViewProjY << "; on Z: " << anAISViewProjZ << "\n";
di << "Up on X : " << anAISViewUpX << "; on Y: " << anAISViewUpY << "; on Z: " << anAISViewUpZ << "\n";
di << "At on X : " << anAISViewAtX << "; on Y: " << anAISViewAtY << "; on Z: " << anAISViewAtZ << "\n";
anAISView->At (anAISViewAtX, anAISViewAtY, anAISViewAtZ);
Standard_Real anAISViewEyeX = 0.0;
Standard_Real anAISViewEyeY = 0.0;
Standard_Real anAISViewEyeZ = 0.0;
anAISView->Eye (anAISViewEyeX, anAISViewEyeY, anAISViewEyeZ);
theDi << "Scale of current view: " << anAISViewScale << "\n";
theDi << "Proj on X : " << anAISViewProjX << "; on Y: " << anAISViewProjY << "; on Z: " << anAISViewProjZ << "\n";
theDi << "Up on X : " << anAISViewUpX << "; on Y: " << anAISViewUpY << "; on Z: " << anAISViewUpZ << "\n";
theDi << "At on X : " << anAISViewAtX << "; on Y: " << anAISViewAtY << "; on Z: " << anAISViewAtZ << "\n";
theDi << "Eye on X : " << anAISViewEyeX << "; on Y: " << anAISViewEyeY << "; on Z: " << anAISViewEyeZ << "\n";
return 0;
}
// -------------------------
// Parse options and values
// -------------------------
NCollection_DataMap<TCollection_AsciiString, TColStd_SequenceOfAsciiString> aMapOfKeysByValues;
TCollection_AsciiString aParseKey;
for (Standard_Integer anArgIt = 1; anArgIt < theArgsNb; ++anArgIt)
{
TCollection_AsciiString anArg (theArgVec [anArgIt]);
if (anArg.Value (1) == '-' && !anArg.IsRealValue())
{
aParseKey = anArg;
aParseKey.Remove (1);
aParseKey.UpperCase();
aMapOfKeysByValues.Bind (aParseKey, TColStd_SequenceOfAsciiString());
continue;
}
aMapOfKeysByValues.ChangeFind (aParseKey).Append (anArg);
}
// ---------------------------------------------
// Change or print parameters, order plays role
// ---------------------------------------------
// Check arguments for validity
NCollection_DataMap<TCollection_AsciiString, TColStd_SequenceOfAsciiString>::Iterator aMapIt (aMapOfKeysByValues);
for (; aMapIt.More(); aMapIt.Next())
{
const TCollection_AsciiString& aKey = aMapIt.Key();
const TColStd_SequenceOfAsciiString& aValues = aMapIt.Value();
if (!(aKey.IsEqual ("SCALE") && (aValues.Length() == 1 || aValues.IsEmpty()))
&& !(aKey.IsEqual ("EYE") && (aValues.Length() == 3 || aValues.IsEmpty()))
&& !(aKey.IsEqual ("AT") && (aValues.Length() == 3 || aValues.IsEmpty()))
&& !(aKey.IsEqual ("UP") && (aValues.Length() == 3 || aValues.IsEmpty()))
&& !(aKey.IsEqual ("PROJ") && (aValues.Length() == 3 || aValues.IsEmpty()))
&& !(aKey.IsEqual ("CENTER") && aValues.Length() == 2))
{
TCollection_AsciiString aLowerKey;
aLowerKey = "-";
aLowerKey += aKey;
aLowerKey.LowerCase();
std::cout << theArgVec[0] << ": " << aLowerKey << " is unknown option, or number of arguments is invalid.\n";
std::cout << "Type help for more information.\n";
return 1;
}
}
TColStd_SequenceOfAsciiString aValues;
// Change view parameters in proper order
if (aMapOfKeysByValues.Find ("SCALE", aValues))
{
if (aValues.IsEmpty())
{
theDi << "Scale: " << anAISView->Scale() << "\n";
}
else
{
Quantity_Factor anAISViewScale = atof (argv [1]);
Standard_Real anAISViewCenterCoordinateX = atof (argv [2]);
Standard_Real anAISViewCenterCoordinateY = atof (argv [3]);
Standard_Real anAISViewProjX = atof (argv [4]);
Standard_Real anAISViewProjY = atof (argv [5]);
Standard_Real anAISViewProjZ = atof (argv [6]);
Standard_Real anAISViewUpX = atof (argv [7]);
Standard_Real anAISViewUpY = atof (argv [8]);
Standard_Real anAISViewUpZ = atof (argv [9]);
Standard_Real anAISViewAtX = atof (argv [10]);
Standard_Real anAISViewAtY = atof (argv [11]);
Standard_Real anAISViewAtZ = atof (argv [12]);
anAISView -> V3d_View::Camera()->BeginUpdate();
anAISView -> V3d_View::SetCenter (anAISViewCenterCoordinateX, anAISViewCenterCoordinateY);
anAISView -> V3d_View::SetAt (anAISViewAtX, anAISViewAtY, anAISViewAtZ);
anAISView -> V3d_View::SetScale (anAISViewScale);
anAISView -> V3d_View::SetProj (anAISViewProjX, anAISViewProjY, anAISViewProjZ);
anAISView -> V3d_View::SetUp (anAISViewUpX, anAISViewUpY, anAISViewUpZ);
anAISView -> V3d_View::Camera()->EndUpdate();
anAISView->SetScale (aValues (1).RealValue());
}
}
if (aMapOfKeysByValues.Find ("EYE", aValues))
{
if (aValues.IsEmpty())
{
Standard_Real anEyeX = 0.0;
Standard_Real anEyeY = 0.0;
Standard_Real anEyeZ = 0.0;
anAISView->Eye (anEyeX, anEyeY, anEyeZ);
theDi << "Eye X: " << anEyeX << " Y: " << anEyeY << " Z: " << anEyeZ << "\n";
}
else
{
anAISView->SetEye (aValues (1).RealValue(), aValues (2).RealValue(), aValues (3).RealValue());
}
}
if (aMapOfKeysByValues.Find ("AT", aValues))
{
if (aValues.IsEmpty())
{
Standard_Real anAtX = 0.0;
Standard_Real anAtY = 0.0;
Standard_Real anAtZ = 0.0;
anAISView->At (anAtX, anAtY, anAtZ);
theDi << "At X: " << anAtX << " Y: " << anAtY << " Z: " << anAtZ << "\n";
}
else
{
anAISView->SetAt (aValues (1).RealValue(), aValues (2).RealValue(), aValues (3).RealValue());
}
}
if (aMapOfKeysByValues.Find ("PROJ", aValues))
{
if (aValues.IsEmpty())
{
Standard_Real aProjX = 0.0;
Standard_Real aProjY = 0.0;
Standard_Real aProjZ = 0.0;
anAISView->Proj (aProjX, aProjY, aProjZ);
theDi << "Proj X: " << aProjX << " Y: " << aProjY << " Z: " << aProjZ << "\n";
}
else
{
anAISView->SetProj (aValues (1).RealValue(), aValues (2).RealValue(), aValues (3).RealValue());
}
}
if (aMapOfKeysByValues.Find ("UP", aValues))
{
if (aValues.IsEmpty())
{
Standard_Real anUpX = 0.0;
Standard_Real anUpY = 0.0;
Standard_Real anUpZ = 0.0;
anAISView->Up (anUpX, anUpY, anUpZ);
theDi << "Up X: " << anUpX << " Y: " << anUpY << " Z: " << anUpZ << "\n";
}
else
{
anAISView->SetUp (aValues (1).RealValue(), aValues (2).RealValue(), aValues (3).RealValue());
}
}
if (aMapOfKeysByValues.Find ("CENTER", aValues))
{
anAISView->SetCenter (aValues (1).IntegerValue(), aValues (2).IntegerValue());
}
return 0;
}
@ -5348,13 +5487,15 @@ static int VSetTextureMode (Draw_Interpretor& theDi, Standard_Integer theArgsNb,
//===============================================================================================
static int VZRange (Draw_Interpretor& theDi, Standard_Integer theArgsNb, const char** theArgVec)
{
if (ViewerTest::CurrentView().IsNull())
const Handle(V3d_View)& aCurrentView = ViewerTest::CurrentView();
if (aCurrentView.IsNull())
{
theDi << theArgVec[0] << ": Call vinit before this command, please.\n";
std::cout << theArgVec[0] << ": Call vinit before this command, please.\n";
return 1;
}
Handle(Graphic3d_Camera) aCamera = ViewerTest::CurrentView()->Camera();
Handle(Graphic3d_Camera) aCamera = aCurrentView->Camera();
if (theArgsNb < 2)
{
@ -5368,17 +5509,29 @@ static int VZRange (Draw_Interpretor& theDi, Standard_Integer theArgsNb, const c
Standard_Real aNewZNear = atof (theArgVec[1]);
Standard_Real aNewZFar = atof (theArgVec[2]);
aCamera->BeginUpdate();
aCamera->SetZFar (aNewZFar);
aCamera->SetZNear (aNewZNear);
aCamera->EndUpdate();
if (aNewZNear >= aNewZFar)
{
std::cout << theArgVec[0] << ": invalid arguments: znear should be less than zfar.\n";
return 1;
}
if (!aCamera->IsOrthographic() && (aNewZNear <= 0.0 || aNewZFar <= 0.0))
{
std::cout << theArgVec[0] << ": invalid arguments: ";
std::cout << "znear, zfar should be positive for perspective camera.\n";
return 1;
}
aCamera->SetZRange (aNewZNear, aNewZFar);
}
else
{
theDi << theArgVec[0] << ": wrong command arguments. Type help for more information.\n";
std::cout << theArgVec[0] << ": wrong command arguments. Type help for more information.\n";
return 1;
}
aCurrentView->Redraw();
return 0;
}
@ -5388,30 +5541,41 @@ static int VZRange (Draw_Interpretor& theDi, Standard_Integer theArgsNb, const c
//===============================================================================================
static int VAutoZFit (Draw_Interpretor& theDi, Standard_Integer theArgsNb, const char** theArgVec)
{
if (ViewerTest::CurrentView().IsNull())
const Handle(V3d_View)& aCurrentView = ViewerTest::CurrentView();
if (aCurrentView.IsNull())
{
theDi << theArgVec[0] << ": Call vinit before this command, please.\n";
std::cout << theArgVec[0] << ": Call vinit before this command, please.\n";
return 1;
}
Standard_Real aScale = aCurrentView->AutoZFitScaleFactor();
if (theArgsNb > 3)
{
std::cout << theArgVec[0] << ": wrong command arguments. Type help for more information.\n";
return 1;
}
if (theArgsNb < 2)
{
theDi << "Auto z-fit mode: " << (ViewerTest::CurrentView()->AutoZFitMode() ? "enabled" : "disabled");
theDi << "Auto z-fit mode: " << "\n"
<< "On: " << (aCurrentView->AutoZFitMode() ? "enabled" : "disabled") << "\n"
<< "Scale: " << aScale << "\n";
return 0;
}
if (theArgsNb == 2)
{
Standard_Real aNewMode = atoi (theArgVec[1]);
Standard_Boolean isOn = Draw::Atoi (theArgVec[1]) == 1;
ViewerTest::CurrentView()->SetAutoZFitMode (aNewMode != 0);
}
else
if (theArgsNb >= 3)
{
theDi << theArgVec[0] << ": wrong command arguments. Type help for more information.\n";
return 1;
aScale = Draw::Atoi (theArgVec[2]);
}
aCurrentView->SetAutoZFitMode (isOn, aScale);
aCurrentView->AutoZFit();
aCurrentView->Redraw();
return 0;
}
@ -5469,13 +5633,10 @@ static int VChangeCamera (Draw_Interpretor& theDi, Standard_Integer theArgsNb, c
theDi << theArgVec[0] << anErrorMessage;
return 1;
}
ViewerTest::CurrentView()->ZFitAll();
}
else if (aCommand == "dist")
{
aCamera->SetDistance (aValue.RealValue());
ViewerTest::CurrentView()->ZFitAll();
}
else if (aCommand == "iod")
{
@ -5527,6 +5688,7 @@ static int VChangeCamera (Draw_Interpretor& theDi, Standard_Integer theArgsNb, c
return 1;
}
ViewerTest::CurrentView()->AutoZFit();
ViewerTest::CurrentView()->Redraw();
return 0;
@ -6309,8 +6471,9 @@ void ViewerTest::ViewerCommands(Draw_Interpretor& theCommands)
theCommands.Add("vfit" ,
"vfit or <F> : vfit",
__FILE__,VFit,group);
theCommands.Add("vzfit" ,
"vzfit",
theCommands.Add ("vzfit", "vzfit [scale]\n"
" Matches Z near, Z far view volume planes to the displayed objects.\n"
" \"scale\" - specifies factor to scale computed z range.\n",
__FILE__, VZFit, group);
theCommands.Add("vrepaint",
"vrepaint : vrepaint, force redraw",
@ -6423,9 +6586,19 @@ void ViewerTest::ViewerCommands(Draw_Interpretor& theCommands)
"vmoveto x y"
"- emulates cursor movement to pixel postion (x,y)",
__FILE__, VMoveTo, group);
theCommands.Add("vviewparams",
"vviewparams [scale center_X center_Y proj_X proj_Y proj_Z up_X up_Y up_Z at_X at_Y at_Z]"
"- gets or sets current view characteristics",
theCommands.Add ("vviewparams", "vviewparams usage:\n"
"- vviewparams\n"
"- vviewparams [-scale [s]] [-eye [x y z]] [-at [x y z]] [-up [x y z]]\n"
" [-proj [x y z]] [-center x y]\n"
"- Gets or sets current view parameters.\n"
"- If called without arguments, all view parameters are printed.\n"
"- The options are:\n"
" -scale [s] : prints or sets viewport scale.\n"
" -eye [x y z] : prints or sets eye location.\n"
" -at [x y z] : prints or sets center of look.\n"
" -up [x y z] : prints or sets direction of up vector.\n"
" -proj [x y z] : prints or sets direction of look.\n"
" -center x y : sets location of center of the screen in pixels.\n",
__FILE__, VViewParams, group);
theCommands.Add("vchangeselected",
"vchangeselected shape"
@ -6457,7 +6630,10 @@ void ViewerTest::ViewerCommands(Draw_Interpretor& theCommands)
" Intraocular distance definition type (absolute value or coefficient).\n",
__FILE__, VChangeCamera, group);
theCommands.Add ("vautozfit", "command to enable or disable automatic z-range adjusting\n"
" vautozfit [1|0]",
"- vautozfit [on={1|0}] [scale]\n"
" Prints or changes parameters of automatic z-fit mode:\n"
" \"on\" - turns automatic z-fit on or off\n"
" \"scale\" - specifies factor to scale computed z range.\n",
__FILE__, VAutoZFit, group);
theCommands.Add ("vzrange", "command to manually access znear and zfar values\n"
" vzrange - without parameters shows current values\n"

View File

@ -638,38 +638,54 @@ is
---Category: Inquire methods
MinMaxValues (me;
XMin, YMin, ZMin : out Real from Standard;
XMax, YMax, ZMax : out Real from Standard )
theXMin, theYMin, theZMin : out Real from Standard;
theXMax, theYMax, theZMax : out Real from Standard;
theToIgnoreInfiniteFlag : Boolean from Standard = Standard_False)
is static;
---Level: Public
---Purpose: Returns the coordinates of the boundary box of all
-- structures displayed in the view <me>.
-- If <theToIgnoreInfiniteFlag> is TRUE, then the boundary box
-- also includes minimum and maximum limits of graphical elements
-- forming parts of infinite structures.
MinMaxValues (me;
ASet : MapOfStructure from Graphic3d;
XMin, YMin, ZMin : out Real from Standard;
XMax, YMax, ZMax : out Real from Standard )
theSet : MapOfStructure from Graphic3d;
theXMin, theYMin, theZMin : out Real from Standard;
theXMax, theYMax, theZMax : out Real from Standard;
theToIgnoreInfiniteFlag : Boolean from Standard = Standard_False)
is static;
---Level: Public
---Purpose: Returns the coordinates of the boundary box of all
-- structures in the set <ASet>.
-- structures in the set <theSet>.
-- If <theToIgnoreInfiniteFlag> is TRUE, then the boundary box
-- also includes minimum and maximum limits of graphical elements
-- forming parts of infinite structures.
MinMaxValues ( me : mutable;
XMin, YMin : out Real from Standard;
XMax, YMax : out Real from Standard )
MinMaxValues (me;
theXMin, theYMin : out Real from Standard;
theXMax, theYMax : out Real from Standard;
theToIgnoreInfiniteFlag : Boolean from Standard = Standard_False)
is static;
---Level: Public
---Purpose: Returns the coordinates of the projection of the
-- boundary box of all structures displayed in the view <me>.
-- If <theToIgnoreInfiniteFlag> is TRUE, then the boundary box
-- also includes minimum and maximum limits of graphical elements
-- forming parts of infinite structures.
MinMaxValues ( me : mutable;
ASet : MapOfStructure from Graphic3d;
XMin, YMin : out Real from Standard;
XMax, YMax : out Real from Standard )
MinMaxValues (me;
theSet : MapOfStructure from Graphic3d;
theXMin, theYMin : out Real from Standard;
theXMax, theYMax : out Real from Standard;
theToIgnoreInfiniteFlag : Boolean from Standard = Standard_False)
is static;
---Level: Public
---Purpose: Returns the coordinates of the projection of the
-- boundary box of all structures in the set <ASet>.
-- If <theToIgnoreInfiniteFlag> is TRUE, then the boundary box
-- also includes minimum and maximum limits of graphical elements
-- forming parts of infinite structures.
NumberOfDisplayedStructures ( me )
returns Integer from Standard
@ -678,7 +694,7 @@ is
---Purpose: Returns number of displayed structures in
-- the view <me>.
Projects ( me : mutable;
Projects (me;
AX, AY, AZ : Real from Standard;
APX, APY, APZ : out Real from Standard )
is static;

View File

@ -1754,110 +1754,166 @@ Graphic3d_MapIteratorOfMapOfStructure Iterator (ASet);
}
void Visual3d_View::MinMaxValues (Standard_Real& XMin, Standard_Real& YMin, Standard_Real& ZMin, Standard_Real& XMax, Standard_Real& YMax, Standard_Real& ZMax) const {
MinMaxValues
(MyDisplayedStructure, XMin, YMin, ZMin, XMax, YMax, ZMax);
//=============================================================================
//function : MinMaxValues
//purpose :
//=============================================================================
void Visual3d_View::MinMaxValues (Standard_Real& theXMin,
Standard_Real& theYMin,
Standard_Real& theZMin,
Standard_Real& theXMax,
Standard_Real& theYMax,
Standard_Real& theZMax,
const Standard_Boolean theToIgnoreInfiniteFlag) const
{
MinMaxValues (MyDisplayedStructure,
theXMin, theYMin, theZMin,
theXMax, theYMax, theZMax,
theToIgnoreInfiniteFlag);
}
void Visual3d_View::MinMaxValues (const Graphic3d_MapOfStructure& ASet, Standard_Real& XMin, Standard_Real& YMin, Standard_Real& ZMin, Standard_Real& XMax, Standard_Real& YMax, Standard_Real& ZMax) const {
//=============================================================================
//function : MinMaxValues
//purpose :
//=============================================================================
void Visual3d_View::MinMaxValues (const Graphic3d_MapOfStructure& theSet,
Standard_Real& theXMin,
Standard_Real& theYMin,
Standard_Real& theZMin,
Standard_Real& theXMax,
Standard_Real& theYMax,
Standard_Real& theZMax,
const Standard_Boolean theToIgnoreInfiniteFlag) const
{
if (theSet.IsEmpty ())
{
theXMin = RealFirst();
theYMin = RealFirst();
theZMin = RealFirst();
if (ASet.IsEmpty ()) {
XMin = RealFirst ();
YMin = RealFirst ();
ZMin = RealFirst ();
XMax = RealLast ();
YMax = RealLast ();
ZMax = RealLast ();
theXMax = RealLast();
theYMax = RealLast();
theZMax = RealLast();
}
else {
else
{
Standard_Real aXm, aYm, aZm, aXM, aYM, aZM;
Graphic3d_MapIteratorOfMapOfStructure anIterator (theSet);
Standard_Real Xm, Ym, Zm, XM, YM, ZM;
Graphic3d_MapIteratorOfMapOfStructure Iterator (ASet);
theXMin = RealLast();
theYMin = RealLast();
theZMin = RealLast();
XMin = RealLast ();
YMin = RealLast ();
ZMin = RealLast ();
theXMax = RealFirst ();
theYMax = RealFirst ();
theZMax = RealFirst ();
XMax = RealFirst ();
YMax = RealFirst ();
ZMax = RealFirst ();
for (anIterator.Initialize (theSet); anIterator.More(); anIterator.Next())
{
const Handle(Graphic3d_Structure)& aStructure = anIterator.Key();
for ( Iterator.Initialize (ASet);
Iterator.More ();
Iterator.Next ()) {
if ((Iterator.Key ())->IsInfinite ()){
if (aStructure->IsInfinite() && !theToIgnoreInfiniteFlag)
{
//XMin, YMin .... ZMax are initialized by means of infinite line data
(Iterator.Key ())->MinMaxValues (Xm, Ym, Zm, XM, YM, ZM);
if ( Xm != RealFirst() && Xm < XMin )
XMin = Xm ;
if ( Ym != RealFirst() && Ym < YMin )
YMin = Ym ;
if ( Zm != RealFirst() && Zm < ZMin )
ZMin = Zm ;
if ( XM != RealLast() && XM > XMax )
XMax = XM ;
if ( YM != RealLast() && YM > YMax )
YMax = YM ;
if ( ZM != RealLast() && ZM > ZMax )
ZMax = ZM ;
aStructure->MinMaxValues (aXm, aYm, aZm, aXM, aYM, aZM, Standard_False);
if (aXm != RealFirst() && aXm < theXMin)
{
theXMin = aXm;
}
if (aYm != RealFirst() && aYm < theYMin)
{
theYMin = aYm;
}
if (aZm != RealFirst() && aZm < theZMin)
{
theZMin = aZm;
}
if (aXM != RealLast() && aXM > theXMax)
{
theXMax = aXM;
}
if (aYM != RealLast() && aYM > theYMax)
{
theYMax = aYM;
}
if (aZM != RealLast() && aZM > theZMax)
{
theZMax = aZM;
}
}
// Only non-empty and non-infinite structures
// are taken into account for calculation of MinMax
if (! (Iterator.Key ())->IsInfinite () &&
! (Iterator.Key ())->IsEmpty ()) {
(Iterator.Key ())->MinMaxValues(Xm, Ym, Zm, XM, YM, ZM);
if ((!aStructure->IsInfinite() || theToIgnoreInfiniteFlag) && !aStructure->IsEmpty())
{
aStructure->MinMaxValues (aXm, aYm, aZm, aXM, aYM, aZM, theToIgnoreInfiniteFlag);
/* ABD 29/10/04 Transform Persistence of Presentation( pan, zoom, rotate ) */
//"FitAll" operation ignores object with transform persitence parameter
if( (Iterator.Key ())->TransformPersistenceMode() == Graphic3d_TMF_None )
if(aStructure->TransformPersistenceMode() == Graphic3d_TMF_None )
{
if (Xm < XMin) XMin = Xm;
if (Ym < YMin) YMin = Ym;
if (Zm < ZMin) ZMin = Zm;
if (XM > XMax) XMax = XM;
if (YM > YMax) YMax = YM;
if (ZM > ZMax) ZMax = ZM;
theXMin = Min (aXm, theXMin);
theYMin = Min (aYm, theYMin);
theZMin = Min (aZm, theZMin);
theXMax = Max (aXM, theXMax);
theYMax = Max (aYM, theYMax);
theZMax = Max (aZM, theZMax);
}
}
}
// The following cases are relevant
// For exemple if all structures are empty or infinite
if (XMax < XMin) { Xm = XMin; XMin = XMax; XMax = Xm; }
if (YMax < YMin) { Ym = YMin; YMin = YMax; YMax = Ym; }
if (ZMax < ZMin) { Zm = ZMin; ZMin = ZMax; ZMax = Zm; }
if (theXMax < theXMin) { aXm = theXMin; theXMin = theXMax; theXMax = aXm; }
if (theYMax < theYMin) { aYm = theYMin; theYMin = theYMax; theYMax = aYm; }
if (theZMax < theZMin) { aZm = theZMin; theZMin = theZMax; theZMax = aZm; }
}
}
void Visual3d_View::MinMaxValues (Standard_Real& XMin, Standard_Real& YMin, Standard_Real& XMax, Standard_Real& YMax) {
MinMaxValues (MyDisplayedStructure, XMin, YMin, XMax, YMax);
//=============================================================================
//function : MinMaxValues
//purpose :
//=============================================================================
void Visual3d_View::MinMaxValues (Standard_Real& theXMin,
Standard_Real& theYMin,
Standard_Real& theXMax,
Standard_Real& theYMax,
const Standard_Boolean theToIgnoreInfiniteFlag) const
{
MinMaxValues (MyDisplayedStructure,
theXMin, theYMin,
theXMax, theYMax,
theToIgnoreInfiniteFlag);
}
void Visual3d_View::MinMaxValues (const Graphic3d_MapOfStructure& ASet, Standard_Real& XMin, Standard_Real& YMin, Standard_Real& XMax, Standard_Real& YMax) {
//=============================================================================
//function : MinMaxValues
//purpose :
//=============================================================================
void Visual3d_View::MinMaxValues (const Graphic3d_MapOfStructure& theSet,
Standard_Real& theXMin,
Standard_Real& theYMin,
Standard_Real& theXMax,
Standard_Real& theYMax,
const Standard_Boolean theToIgnoreInfiniteFlag) const
{
Standard_Real aXm, aYm, aZm, aXM, aYM, aZM;
Standard_Real aXp, aYp, aZp;
Standard_Real Xm, Ym, Zm, XM, YM, ZM;
Standard_Real Xp, Yp, Zp;
MinMaxValues (theSet, aXm, aYm, aZm, aXM, aYM, aZM, theToIgnoreInfiniteFlag);
MinMaxValues (ASet, Xm, Ym, Zm, XM, YM, ZM);
Projects (aXm, aYm, aZm, aXp, aYp, aZp);
theXMin = aXp;
theYMin = aYp;
Projects (Xm, Ym, Zm, Xp, Yp, Zp);
XMin = Xp;
YMin = Yp;
Projects (aXM, aYM, aZM, aXp, aYp, aZp);
theXMax = aXp;
theYMax = aYp;
Projects (XM, YM, ZM, Xp, Yp, Zp);
XMax = Xp;
YMax = Yp;
if (XMax < XMin) { Xp = XMax; XMax = XMin; XMin = Xp; }
if (YMax < YMin) { Yp = YMax; YMax = YMin; YMin = Yp; }
if (theXMax < theXMin) { aXp = theXMax; theXMax = theXMin; theXMin = aXp; }
if (theYMax < theYMin) { aYp = theYMax; theYMax = theYMin; theYMin = aYp; }
}
Standard_Integer Visual3d_View::NumberOfDisplayedStructures () const {
Standard_Integer Result = MyDisplayedStructure.Extent ();
@ -1866,28 +1922,30 @@ Standard_Integer Result = MyDisplayedStructure.Extent ();
}
void Visual3d_View::Projects (const Standard_Real AX,
const Standard_Real AY,
const Standard_Real AZ,
Standard_Real& APX,
Standard_Real& APY,
Standard_Real& APZ)
//=======================================================================
//function : Projects
//purpose :
//=======================================================================
void Visual3d_View::Projects (const Standard_Real theX,
const Standard_Real theY,
const Standard_Real theZ,
Standard_Real& thePX,
Standard_Real& thePY,
Standard_Real& thePZ) const
{
Handle(Graphic3d_Camera) aCamera = MyCView.Context.Camera;
const Handle(Graphic3d_Camera)& aCamera = MyCView.Context.Camera;
Standard_Real aUmin, aVMin, aUMax, aVMax;
Standard_Real aNear, aFar;
aCamera->WindowLimit (aUmin, aVMin, aUMax, aVMax);
gp_XYZ aViewSpaceDimensions = aCamera->ViewDimensions();
Standard_Real aXSize = aViewSpaceDimensions.X();
Standard_Real aYSize = aViewSpaceDimensions.Y();
Standard_Real aZSize = aViewSpaceDimensions.Z();
aNear = aCamera->ZNear();
aFar = aCamera->ZFar();
gp_Pnt aPoint = aCamera->Project (gp_Pnt (theX, theY, theZ));
gp_Pnt aPoint (AX, AY, AZ);
aPoint = aCamera->Project (aPoint);
APX = (aPoint.X() + 1) * 0.5 * (aUMax - aUmin) + aUmin;
APY = (aPoint.Y() + 1) * 0.5 * (aVMax - aVMin) + aVMin;
APZ = aPoint.Z() * (aFar - aNear) + aNear;
// NDC [-1, 1] --> PROJ [ -size / 2, +size / 2 ]
thePX = aPoint.X() * aXSize * 0.5;
thePY = aPoint.Y() * aYSize * 0.5;
thePZ = aPoint.Z() * aZSize * 0.5;
}
Standard_Integer Visual3d_View::Identification () const {

View File

@ -31,21 +31,17 @@ set only_screen 0
set scale 2.7840527693872859
set center_X 3.7559505017270567e-07
set center_Y -71.035163389154491
set proj_X -0.89892524480819702
set proj_Y -0.37323716282844543
set proj_Z -0.22940616309642792
set up_X -0.41990724205970764
set up_Y 0.58468854427337646
set up_Z 0.69413024187088013
set at_X -74.980735778808594
set at_Y 22.785961151123047
set at_Z -49.215263366699219
set at_X -44.6832661344329
set at_Y -21.4529078187916
set at_Z -95.9601818852522
vviewparams ${scale} ${center_X} ${center_Y} \
${proj_X} ${proj_Y} ${proj_Z} \
${up_X} ${up_Y} ${up_Z} \
${at_X} ${at_Y} ${at_Z}
vviewparams -scale ${scale} -proj ${proj_X} ${proj_Y} ${proj_Z} -up ${up_X} ${up_Y} ${up_Z} -at ${at_X} ${at_Y} ${at_Z}
set only_screen 0

View File

@ -34,22 +34,17 @@ set nb_shape_good 58
vfit
set scale 5.8955238204183011
set center_X -43.928617104386774
set center_Y 295.47887425975171
set proj_X 0.62061613798141479
set proj_Y -0.6891753077507019
set proj_Z -0.37399500608444214
set up_X -0.12894462049007416
set up_Y -0.56017255783081055
set up_Z 0.81827831268310547
set at_X 15.248310089111328
set at_Y 165.90042114257812
set at_Z 225.19309997558594
set at_X -56.828238528324
set at_Y -19.8089213662065
set at_Z 447.801500039167
vviewparams ${scale} ${center_X} ${center_Y} \
${proj_X} ${proj_Y} ${proj_Z} \
${up_X} ${up_Y} ${up_Z} \
${at_X} ${at_Y} ${at_Z}
vviewparams -scale ${scale} -proj ${proj_X} ${proj_Y} ${proj_Z} -up ${up_X} ${up_Y} ${up_Z} -at ${at_X} ${at_Y} ${at_Z}
}

View File

@ -32,22 +32,17 @@ vsetdispmode 0
vfit
set scale 5.8136266443689317
set center_X -34.878384652992025
set center_Y 41.518039353084561
set proj_X 0.5689244270324707
set proj_Y -0.54117375612258911
set proj_Z -0.61923813819885254
set up_X 0.48309960961341858
set up_Y -0.38943690061569214
set up_Z 0.78418976068496704
set at_X -38.500396728515625
set at_Y 34.677536010742188
set at_Z -7.9150166511535645
set at_X -41.655908269392
set at_Y -7.48592829187374
set at_Z 26.0339793965026
vviewparams ${scale} ${center_X} ${center_Y} \
${proj_X} ${proj_Y} ${proj_Z} \
${up_X} ${up_Y} ${up_Z} \
${at_X} ${at_Y} ${at_Z}
vviewparams -scale ${scale} -proj ${proj_X} ${proj_Y} ${proj_Z} -up ${up_X} ${up_Y} ${up_Z} -at ${at_X} ${at_Y} ${at_Z}
set only_screen 0

View File

@ -33,21 +33,17 @@ vfit
set scale 6.3723487126883533
set center_X -4.2632564145606011e-14
set center_Y -22.430308400362279
set proj_X 0.57735025882720947
set proj_Y -0.57735025882720947
set proj_Z 0.57735025882720947
set up_X -0.40824827551841736
set up_Y 0.40824827551841736
set up_Z 0.81649655103683472
set at_X 0
set at_Y 0
set at_Z 0
set at_X 6.14255753835228
set at_Y -12.171712579698
set at_Z -18.3142701180503
vviewparams ${scale} ${center_X} ${center_Y} \
${proj_X} ${proj_Y} ${proj_Z} \
${up_X} ${up_Y} ${up_Z} \
${at_X} ${at_Y} ${at_Z}
vviewparams -scale ${scale} -proj ${proj_X} ${proj_Y} ${proj_Z} -up ${up_X} ${up_Y} ${up_Z} -at ${at_X} ${at_Y} ${at_Z}
set only_screen 0

View File

@ -32,22 +32,17 @@ vsetdispmode 0
vfit
set scale 17.084273613995954
set center_X 210.44987026890158
set center_Y -5.2570485620847549
set proj_X 0.98952245712280273
set proj_Y -0.12535266578197479
set proj_Z 0.071637466549873352
set up_X -0.016377445310354233
set up_Y 0.39552098512649536
set up_Z 0.91831082105636597
set at_X 121.38485717773438
set at_Y -46.730243682861328
set at_Z 83.376449584960938
set at_X 151.659324986196
set at_Y 142.670935515999
set at_Z -3.38433863631535
vviewparams ${scale} ${center_X} ${center_Y} \
${proj_X} ${proj_Y} ${proj_Z} \
${up_X} ${up_Y} ${up_Z} \
${at_X} ${at_Y} ${at_Z}
vviewparams -scale ${scale} -proj ${proj_X} ${proj_Y} ${proj_Z} -up ${up_X} ${up_Y} ${up_Z} -at ${at_X} ${at_Y} ${at_Z}
set only_screen 0

View File

@ -32,22 +32,17 @@ vsetdispmode 0
vfit
set scale 5.8136266443689317
set center_X -34.878384652992025
set center_Y 41.518039353084561
set proj_X 0.5689244270324707
set proj_Y -0.54117375612258911
set proj_Z -0.61923813819885254
set up_X 0.48309960961341858
set up_Y -0.38943690061569214
set up_Z 0.78418976068496704
set at_X -38.500396728515625
set at_Y 34.677536010742188
set at_Z -7.9150166511535645
set at_X -41.655908269392
set at_Y -7.48592829187374
set at_Z 26.0339793965026
vviewparams ${scale} ${center_X} ${center_Y} \
${proj_X} ${proj_Y} ${proj_Z} \
${up_X} ${up_Y} ${up_Z} \
${at_X} ${at_Y} ${at_Z}
vviewparams -scale ${scale} -proj ${proj_X} ${proj_Y} ${proj_Z} -up ${up_X} ${up_Y} ${up_Z} -at ${at_X} ${at_Y} ${at_Z}
set only_screen 0

View File

@ -32,22 +32,17 @@ vsetdispmode 0
vfit
set scale 5.4752524438940986
set center_X 0.12443750381514462
set center_Y 30.91257192276079
set proj_X 0.75705158710479736
set proj_Y -0.55456298589706421
set proj_Z 0.34544554352760315
set up_X -0.26271694898605347
set up_Y 0.22571359574794769
set up_Z 0.93810069561004639
set at_X -8.4405813217163086
set at_Y 5.1293683052062988
set at_Z 1.3484655618667603
set at_X -16.4873994814895
set at_Y 12.2064246030849
set at_Z 30.344440786584
vviewparams ${scale} ${center_X} ${center_Y} \
${proj_X} ${proj_Y} ${proj_Z} \
${up_X} ${up_Y} ${up_Z} \
${at_X} ${at_Y} ${at_Z}
vviewparams -scale ${scale} -proj ${proj_X} ${proj_Y} ${proj_Z} -up ${up_X} ${up_Y} ${up_Z} -at ${at_X} ${at_Y} ${at_Z}
set only_screen 0

View File

@ -32,22 +32,17 @@ vsetdispmode 0
vfit
set scale 5.4752524438940986
set center_X 0.12443750381514462
set center_Y 30.91257192276079
set proj_X 0.75705158710479736
set proj_Y -0.55456298589706421
set proj_Z 0.34544554352760315
set up_X -0.26271694898605347
set up_Y 0.22571359574794769
set up_Z 0.93810069561004639
set at_X -8.4405813217163086
set at_Y 5.1293683052062988
set at_Z 1.3484655618667603
set at_X -16.4873994814895
set at_Y 12.2064246030849
set at_Z 30.344440786584
vviewparams ${scale} ${center_X} ${center_Y} \
${proj_X} ${proj_Y} ${proj_Z} \
${up_X} ${up_Y} ${up_Z} \
${at_X} ${at_Y} ${at_Z}
vviewparams -scale ${scale} -proj ${proj_X} ${proj_Y} ${proj_Z} -up ${up_X} ${up_Y} ${up_Z} -at ${at_X} ${at_Y} ${at_Z}
set only_screen 0

View File

@ -32,22 +32,17 @@ vsetdispmode 0
vfit
set scale 4.1681300306816444
set center_X 0.13164276086378379
set center_Y 6.6154949824974238
set proj_X 0.48621529340744019
set proj_Y -0.47558537125587463
set proj_Z 0.73308473825454712
set up_X -0.51949578523635864
set up_Y 0.51725912094116211
set up_Z 0.68012285232543945
set at_X 1.1775522232055664
set at_Y -1.214188814163208
set at_Z 0.14915035665035248
set at_X -2.16667064830908
set at_Y 2.30140290143177
set at_Z 4.64791596010368
vviewparams ${scale} ${center_X} ${center_Y} \
${proj_X} ${proj_Y} ${proj_Z} \
${up_X} ${up_Y} ${up_Z} \
${at_X} ${at_Y} ${at_Z}
vviewparams -scale ${scale} -proj ${proj_X} ${proj_Y} ${proj_Z} -up ${up_X} ${up_Y} ${up_Z} -at ${at_X} ${at_Y} ${at_Z}
set only_screen 0

View File

@ -32,22 +32,17 @@ vsetdispmode 0
vfit
set scale 4.1681300306816444
set center_X 0.13164276086378379
set center_Y 6.6154949824974238
set proj_X 0.48621529340744019
set proj_Y -0.47558537125587463
set proj_Z 0.73308473825454712
set up_X -0.51949578523635864
set up_Y 0.51725912094116211
set up_Z 0.68012285232543945
set at_X 1.1775522232055664
set at_Y -1.214188814163208
set at_Z 0.14915035665035248
set at_X -2.16667064830908
set at_Y 2.30140290143177
set at_Z 4.64791596010368
vviewparams ${scale} ${center_X} ${center_Y} \
${proj_X} ${proj_Y} ${proj_Z} \
${up_X} ${up_Y} ${up_Z} \
${at_X} ${at_Y} ${at_Z}
vviewparams -scale ${scale} -proj ${proj_X} ${proj_Y} ${proj_Z} -up ${up_X} ${up_Y} ${up_Z} -at ${at_X} ${at_Y} ${at_Z}
set only_screen 0

View File

@ -32,22 +32,17 @@ vsetdispmode 0
vfit
set scale 5.7979972910353759
set center_X 134.00320461480183
set center_Y 57.36536300752401
set proj_X 0.40099617838859558
set proj_Y -0.39083370566368103
set proj_Z 0.82852339744567871
set up_X -0.58777821063995361
set up_Y 0.58394128084182739
set up_Z 0.55993682146072388
set at_X 14.468252182006836
set at_Y -14.975484848022461
set at_Z -8.813446044921875
set at_X 74.9076600209737
set at_Y 113.868559295313
set at_Z 22.713272605878
vviewparams ${scale} ${center_X} ${center_Y} \
${proj_X} ${proj_Y} ${proj_Z} \
${up_X} ${up_Y} ${up_Z} \
${at_X} ${at_Y} ${at_Z}
vviewparams -scale ${scale} -proj ${proj_X} ${proj_Y} ${proj_Z} -up ${up_X} ${up_Y} ${up_Z} -at ${at_X} ${at_Y} ${at_Z}
set only_screen 0

View File

@ -32,22 +32,17 @@ vsetdispmode 0
vfit
set scale 5.7979972910353759
set center_X 134.00320461480183
set center_Y 57.36536300752401
set proj_X 0.40099617838859558
set proj_Y -0.39083370566368103
set proj_Z 0.82852339744567871
set up_X -0.58777821063995361
set up_Y 0.58394128084182739
set up_Z 0.55993682146072388
set at_X 14.468252182006836
set at_Y -14.975484848022461
set at_Z -8.813446044921875
set at_X 74.9076600209737
set at_Y 113.868559295313
set at_Z 22.713272605878
vviewparams ${scale} ${center_X} ${center_Y} \
${proj_X} ${proj_Y} ${proj_Z} \
${up_X} ${up_Y} ${up_Z} \
${at_X} ${at_Y} ${at_Z}
vviewparams -scale ${scale} -proj ${proj_X} ${proj_Y} ${proj_Z} -up ${up_X} ${up_Y} ${up_Z} -at ${at_X} ${at_Y} ${at_Z}
set only_screen 0

View File

@ -32,22 +32,17 @@ vsetdispmode 0
vfit
set scale 17.084273613995954
set center_X 210.44987026890158
set center_Y -5.2570485620847549
set proj_X 0.98952245712280273
set proj_Y -0.12535266578197479
set proj_Z 0.071637466549873352
set up_X -0.016377445310354233
set up_Y 0.39552098512649536
set up_Z 0.91831082105636597
set at_X 121.38485717773438
set at_Y -46.730243682861328
set at_Z 83.376449584960938
set at_X 151.659324986196
set at_Y 142.670935515999
set at_Z -3.38433863631535
vviewparams ${scale} ${center_X} ${center_Y} \
${proj_X} ${proj_Y} ${proj_Z} \
${up_X} ${up_Y} ${up_Z} \
${at_X} ${at_Y} ${at_Z}
vviewparams -scale ${scale} -proj ${proj_X} ${proj_Y} ${proj_Z} -up ${up_X} ${up_Y} ${up_Z} -at ${at_X} ${at_Y} ${at_Z}
set only_screen 0

View File

@ -32,22 +32,17 @@ vsetdispmode 0
vfit
set scale 4.1681300306816444
set center_X 0.13164276086378379
set center_Y 6.6154949824974238
set proj_X 0.48621529340744019
set proj_Y -0.47558537125587463
set proj_Z 0.73308473825454712
set up_X -0.51949578523635864
set up_Y 0.51725912094116211
set up_Z 0.68012285232543945
set at_X 1.1775522232055664
set at_Y -1.214188814163208
set at_Z 0.14915035665035248
set at_X -2.16667064830908
set at_Y 2.30140290143177
set at_Z 4.64791596010368
vviewparams ${scale} ${center_X} ${center_Y} \
${proj_X} ${proj_Y} ${proj_Z} \
${up_X} ${up_Y} ${up_Z} \
${at_X} ${at_Y} ${at_Z}
vviewparams -scale ${scale} -proj ${proj_X} ${proj_Y} ${proj_Z} -up ${up_X} ${up_Y} ${up_Z} -at ${at_X} ${at_Y} ${at_Z}
set only_screen 0

View File

@ -32,22 +32,17 @@ vsetdispmode 0
vfit
set scale 4.1681300306816444
set center_X 0.13164276086378379
set center_Y 6.6154949824974238
set proj_X 0.48621529340744019
set proj_Y -0.47558537125587463
set proj_Z 0.73308473825454712
set up_X -0.51949578523635864
set up_Y 0.51725912094116211
set up_Z 0.68012285232543945
set at_X 1.1775522232055664
set at_Y -1.214188814163208
set at_Z 0.14915035665035248
set at_X -2.16667064830908
set at_Y 2.30140290143177
set at_Z 4.64791596010368
vviewparams ${scale} ${center_X} ${center_Y} \
${proj_X} ${proj_Y} ${proj_Z} \
${up_X} ${up_Y} ${up_Z} \
${at_X} ${at_Y} ${at_Z}
vviewparams -scale ${scale} -proj ${proj_X} ${proj_Y} ${proj_Z} -up ${up_X} ${up_Y} ${up_Z} -at ${at_X} ${at_Y} ${at_Z}
set only_screen 0

View File

@ -32,22 +32,17 @@ vsetdispmode 0
vfit
set scale 5.7979972910353759
set center_X 134.00320461480183
set center_Y 57.36536300752401
set proj_X 0.40099617838859558
set proj_Y -0.39083370566368103
set proj_Z 0.82852339744567871
set up_X -0.58777821063995361
set up_Y 0.58394128084182739
set up_Z 0.55993682146072388
set at_X 14.468252182006836
set at_Y -14.975484848022461
set at_Z -8.813446044921875
set at_X 74.9076600209737
set at_Y 113.868559295313
set at_Z 22.713272605878
vviewparams ${scale} ${center_X} ${center_Y} \
${proj_X} ${proj_Y} ${proj_Z} \
${up_X} ${up_Y} ${up_Z} \
${at_X} ${at_Y} ${at_Z}
vviewparams -scale ${scale} -proj ${proj_X} ${proj_Y} ${proj_Z} -up ${up_X} ${up_Y} ${up_Z} -at ${at_X} ${at_Y} ${at_Z}
set only_screen 0

View File

@ -32,22 +32,17 @@ vsetdispmode 0
vfit
set scale 5.7979972910353759
set center_X 134.00320461480183
set center_Y 57.36536300752401
set proj_X 0.40099617838859558
set proj_Y -0.39083370566368103
set proj_Z 0.82852339744567871
set up_X -0.58777821063995361
set up_Y 0.58394128084182739
set up_Z 0.55993682146072388
set at_X 14.468252182006836
set at_Y -14.975484848022461
set at_Z -8.813446044921875
set at_X 74.9076600209737
set at_Y 113.868559295313
set at_Z 22.713272605878
vviewparams ${scale} ${center_X} ${center_Y} \
${proj_X} ${proj_Y} ${proj_Z} \
${up_X} ${up_Y} ${up_Z} \
${at_X} ${at_Y} ${at_Z}
vviewparams -scale ${scale} -proj ${proj_X} ${proj_Y} ${proj_Z} -up ${up_X} ${up_Y} ${up_Z} -at ${at_X} ${at_Y} ${at_Z}
set only_screen 0

View File

@ -33,21 +33,17 @@ vfit
set scale 6.3723487126883533
set center_X -4.2632564145606011e-14
set center_Y -22.430308400362279
set proj_X 0.57735025882720947
set proj_Y -0.57735025882720947
set proj_Z 0.57735025882720947
set up_X -0.40824827551841736
set up_Y 0.40824827551841736
set up_Z 0.81649655103683472
set at_X 0
set at_Y 0
set at_Z 0
set at_X 6.14255753835228
set at_Y -12.171712579698
set at_Z -18.3142701180503
vviewparams ${scale} ${center_X} ${center_Y} \
${proj_X} ${proj_Y} ${proj_Z} \
${up_X} ${up_Y} ${up_Z} \
${at_X} ${at_Y} ${at_Z}
vviewparams -scale ${scale} -proj ${proj_X} ${proj_Y} ${proj_Z} -up ${up_X} ${up_Y} ${up_Z} -at ${at_X} ${at_Y} ${at_Z}
set only_screen 0

View File

@ -14,17 +14,15 @@ set BugNumber OCC21415
# Data
set scale 19.469810863701095
set center_X 436.67687011410339
set center_Y 148.0981469658436
set proj_X 0.99999862909317017
set proj_Y 0.0012245246907696128
set proj_Z -0.0011169711360707879
set up_X 0.00037844621692784131
set up_Y 0.48741284012794495
set up_Z 0.87317168712615967
set at_X 291.61880493164062
set at_Y -453.53787231445312
set at_Z 82.229469299316406
set at_X 290.970210143045
set at_Y -0.0594423932820831
set at_Z -1.29683163874688
# Start
@ -37,10 +35,7 @@ vsetdispmode 1
vfit
vviewparams ${scale} ${center_X} ${center_Y} \
${proj_X} ${proj_Y} ${proj_Z} \
${up_X} ${up_Y} ${up_Z} \
${at_X} ${at_Y} ${at_Z}
vviewparams -scale ${scale} -proj ${proj_X} ${proj_Y} ${proj_Z} -up ${up_X} ${up_Y} ${up_Z} -at ${at_X} ${at_Y} ${at_Z}
puts "TEMPORARY!!!!!!!!!!!!!!!!!"
set square 400000

View File

@ -13,17 +13,15 @@ set BugNumber OCC21909
# Data
set scale 57.547428234801195
set center_X -29.161882474505589
set center_Y -27.085456554411167
set proj_X -0.25567048788070679
set proj_Y -0.92769843339920044
set proj_Z 0.27204453945159912
set up_X 0.43156850337982178
set up_Y 0.14228194952011108
set up_Z 0.89078855514526367
set at_X 53.189125061035156
set at_Y -25.674787521362305
set at_Z -2.9377093315124512
set at_X 16.2722331487924
set at_Y -19.463212261103
set at_Z -16.4505465814645
set x1 190
@ -40,10 +38,7 @@ vfit
vsetdispmode 1
vfit
vviewparams ${scale} ${center_X} ${center_Y} \
${proj_X} ${proj_Y} ${proj_Z} \
${up_X} ${up_Y} ${up_Z} \
${at_X} ${at_Y} ${at_Z}
vviewparams -scale ${scale} -proj ${proj_X} ${proj_Y} ${proj_Z} -up ${up_X} ${up_Y} ${up_Z} -at ${at_X} ${at_Y} ${at_Z}
vmoveto ${x1} ${y1}
vmoveto ${x1} ${y1}

View File

@ -10,17 +10,15 @@ puts ""
pload QAcommands
set scale 73.609
set center_X 7.93702
set center_Y 0.264503
set proj_X 0.523995
set proj_Y 0.359655
set proj_Z 0.77206
set up_X -0.739036
set up_Y -0.258607
set up_Z 0.622051
set at_X 9.06773
set at_Y -1.93771
set at_Z 1.45124
set at_X 5.51184366274157
set at_Y 5.10968389884332
set at_Z 0.581665443993578
set x_coord 210
set y_coord 210
@ -40,10 +38,7 @@ if { ${status} == 0} {
vsetdispmode 1
vdisplay result
vviewparams ${scale} ${center_X} ${center_Y} \
${proj_X} ${proj_Y} ${proj_Z} \
${up_X} ${up_Y} ${up_Z} \
${at_X} ${at_Y} ${at_Z}
vviewparams -scale ${scale} -proj ${proj_X} ${proj_Y} ${proj_Z} -up ${up_X} ${up_Y} ${up_Z} -at ${at_X} ${at_Y} ${at_Z}
checkcolor $x_coord $y_coord 0.98 0.72 0.13

View File

@ -21,21 +21,16 @@ vfit
set scale 71.101493567712652
set center_X 8.280398902360842
set center_Y 7.1615404015522026
set proj_X -0.14605970947882216
set proj_Y -0.18639384905183365
set proj_Z 0.97155745805516014
set up_X -0.587582742029223
set up_Y 0.80643668322534767
set up_Z 0.066380699137021923
set at_X 3.9226062794202492
set at_Y -3.6740070074451168
set at_Z 6.1530005464201167
set at_X 6.30475074082204
set at_Y 6.748073489527
set at_Z 8.5106037329062
vviewparams ${scale} ${center_X} ${center_Y} \
${proj_X} ${proj_Y} ${proj_Z} \
${up_X} ${up_Y} ${up_Z} \
${at_X} ${at_Y} ${at_Z}
vviewparams -scale ${scale} -proj ${proj_X} ${proj_Y} ${proj_Z} -up ${up_X} ${up_Y} ${up_Z} -at ${at_X} ${at_Y} ${at_Z}
set only_screen 1

View File

@ -18,7 +18,7 @@ vinit
vdisplay result
vsetdispmode result 1
vviewparams 5.1346924 95.358439 -4.910448 0.23495967 -0.302 0.923899 -0.7304302 0.5722587 0.372815 9.550874 -7.55706 -28.83166
vviewparams -scale 5.1346924 -proj 0.23495967 -0.302 0.923899 -up -0.7304302 0.5722587 0.372815 -at 74.2909604913005 62.3380479127367 -22.4489114507273
isos result 0
triangles result

View File

@ -18,7 +18,7 @@ wire w_1 e_1 e_2 e_3 e_4
mkplane r w_1
vdisplay r
vfit
vselect 120 21
vselect 120 22
puts "WARNING : The rectangular MUST be highlighted !"
puts ""

View File

@ -12,17 +12,15 @@ set X_02 204
set Y_02 300
set scale 60.6309
set center_X 7.07107
set center_Y 4.08248
set proj_X 0.479541
set proj_Y 0.586729
set proj_Z 0.652525
set up_X -0.838029
set up_Y 0.0856396
set up_Z 0.538863
set at_X 8.87741
set at_Y -2.73728
set at_Z 4.68363
set at_X 3.61568258316782
set at_Y 3.30626448080767
set at_Z 3.11631746104816
# Display two face
vinit
@ -57,6 +55,6 @@ vmoveto ${X_02} ${Y_02}
checkcolor ${X_02} ${Y_02} 0 1 1
# Rotation
vviewparams ${scale} ${center_X} ${center_Y} ${proj_X} ${proj_Y} ${proj_Z} ${up_X} ${up_Y} ${up_Z} ${at_X} ${at_Y} ${at_Z}
vviewparams -scale ${scale} -proj ${proj_X} ${proj_Y} ${proj_Z} -up ${up_X} ${up_Y} ${up_Z} -at ${at_X} ${at_Y} ${at_Z}
set only_screen 1

View File

@ -20,19 +20,17 @@ vdisplay a
vfit
set scale 2.50501
set center_X 191.285
set center_Y 76.6556
set proj_X 0.672033
set proj_Y -0.721033
set proj_Z 0.168771
set up_X -0.131494
set up_Y 0.108095
set up_Z 0.985406
set at_X -27.258
set at_Y 30.2321
set at_Z -9.0201
set at_X 102.061817325836
set at_Y 169.436979868935
set at_Z 70.7572056943368
vviewparams ${scale} ${center_X} ${center_Y} ${proj_X} ${proj_Y} ${proj_Z} ${up_X} ${up_Y} ${up_Z} ${at_X} ${at_Y} ${at_Z}
vviewparams -scale ${scale} -proj ${proj_X} ${proj_Y} ${proj_Z} -up ${up_X} ${up_Y} ${up_Z} -at ${at_X} ${at_Y} ${at_Z}
set x_GREEN 300
set y_GREEN 180

View File

@ -10,7 +10,7 @@ set y_coord 171
vinit
OCC128
vviewparams 4.9487928 89.23589 4.1505 0.7329295 0.59461397 0.33052679 -0.536849 0.2071041 0.81786 71.971878 -17.250309 33.509651
vviewparams -scale 4.9487928 -proj 0.7329295 0.59461397 0.33052679 -up -0.536849 0.2071041 0.81786 -at 32.4556665273951 52.9347942181675 -5.1270029887922
checkcolor $x_coord $y_coord 0.43 0.48 0.54

View File

@ -46,7 +46,7 @@ checkcolor $x_coord $y_coord 0 1 1
set x_coord 105
set y_coord 340
vviewparams 60.6309 7.07107 4.08248 0.592163 -0.60038 -0.537482 0.369921 -0.390032 0.843228 -3.28175 3.38875 3.0464
vviewparams -scale 60.6309 -proj 0.592163 -0.60038 -0.537482 -up 0.369921 -0.390032 0.843228 -at 3.29057034725635 6.73314999296002 6.55157729015654
checkcolor $x_coord $y_coord 0.78 0.54 0.09

View File

@ -44,7 +44,7 @@ set y_coord 340
checkcolor $x_coord $y_coord 0 1 1
vviewparams 60.6309 7.07107 4.08248 0.592163 -0.60038 -0.537482 0.369921 -0.390032 0.843228 -3.28175 3.38875 3.0464
vviewparams -scale 60.6309 -proj 0.592163 -0.60038 -0.537482 -up 0.369921 -0.390032 0.843228 -at 3.29057034725635 6.73314999296002 6.55157729015654
set x_coord 105
set y_coord 340

View File

@ -11,19 +11,17 @@ vdisplay result
vfit
set scale 6.29714883567995
set center_X 70.7106779835678
set center_Y 41.2330922040446
set proj_X 0.344812899827957
set proj_Y -0.830477952957153
set proj_Z 0.43750473856926
set up_X -0.368759274482727
set up_Y 0.308769434690475
set up_Z 0.876742839813232
set at_X -5.88607025146484
set at_Y 28.6973209381104
set at_Z -12.5332689285278
set at_X 39.9465644699194
set at_Y 74.2135758209193
set at_Z 37.7440421525395
vviewparams ${scale} ${center_X} ${center_Y} ${proj_X} ${proj_Y} ${proj_Z} ${up_X} ${up_Y} ${up_Z} ${at_X} ${at_Y} ${at_Z}
vviewparams -scale ${scale} -proj ${proj_X} ${proj_Y} ${proj_Z} -up ${up_X} ${up_Y} ${up_Z} -at ${at_X} ${at_Y} ${at_Z}
set x_coord 229
set y_coord 94

View File

@ -10,22 +10,20 @@ vdisplay b_1
vfit
set scale 7674.87317785833
set center_X -2.16918246707847
set center_Y 9.87290703657064
set proj_X 0.966540098190308
set proj_Y -0.24304473400116
set proj_Z 0.0820330902934074
set up_X -0.0460147373378277
set up_Y 0.150333747267723
set up_Z 0.987563848495483
set at_X 1.04834496974945
set at_Y 0.741619229316711
set at_Z -0.0881031528115273
set at_X 0.0466426680664981
set at_Y 0.147133996816294
set at_Z 9.95295385008357
set x_coord 388
set y_coord 28
vviewparams ${scale} ${center_X} ${center_Y} ${proj_X} ${proj_Y} ${proj_Z} ${up_X} ${up_Y} ${up_Z} ${at_X} ${at_Y} ${at_Z}
vviewparams -scale ${scale} -proj ${proj_X} ${proj_Y} ${proj_Z} -up ${up_X} ${up_Y} ${up_Z} -at ${at_X} ${at_Y} ${at_Z}
OCC218 trihedron1 b_1 X Y

View File

@ -11,17 +11,15 @@ set BugNumber OCC22313
# Data
set scale 2.9701073117025172
set center_X -1339.0679502864409
set center_Y -2077.3454643258542
set proj_X 0.4096425473690033
set proj_Y 0.77340573072433472
set proj_Z 0.48377299308776855
set up_X -0.83569550514221191
set up_Y 0.1055084615945816
set up_Z 0.538962721824646
set at_X -2857.961669921875
set at_Y -1655.37939453125
set at_Z -1782.80908203125
set at_X -632.109173226325
set at_Y -2711.56694941045
set at_Z -1979.06316609577
set x1 300
@ -42,10 +40,7 @@ vsetdispmode 1
vfit
vviewparams ${scale} ${center_X} ${center_Y} \
${proj_X} ${proj_Y} ${proj_Z} \
${up_X} ${up_Y} ${up_Z} \
${at_X} ${at_Y} ${at_Z}
vviewparams -scale ${scale} -proj ${proj_X} ${proj_Y} ${proj_Z} -up ${up_X} ${up_Y} ${up_Z} -at ${at_X} ${at_Y} ${at_Z}
checkcolor ${x1} ${y1} ${Artifact_R} ${Artifact_G} ${Artifact_B}

View File

@ -11,17 +11,15 @@ set BugNumber OCC22701
# Data
set scale 276.45658048904141
set center_X 0.41566799352988693
set center_Y -1.4232027731292387
set proj_X -0.8895147442817688
set proj_Y -0.37965071201324463
set proj_Z 0.25422060489654541
set up_X -0.055201318114995956
set up_Y 0.64161688089370728
set up_Z 0.76503568887710571
set at_X -0.018965641036629677
set at_Y 1.2994236946105957
set at_Z -0.41784921288490295
set at_X 0.248127012715387
set at_Y 0.109238834542233
set at_Z -1.2607059785715
set x1 105
set y1 275
@ -47,10 +45,7 @@ vsetdispmode 1
vfit
vviewparams ${scale} ${center_X} ${center_Y} \
${proj_X} ${proj_Y} ${proj_Z} \
${up_X} ${up_Y} ${up_Z} \
${at_X} ${at_Y} ${at_Z}
vviewparams -scale ${scale} -proj ${proj_X} ${proj_Y} ${proj_Z} -up ${up_X} ${up_Y} ${up_Z} -at ${at_X} ${at_Y} ${at_Z}
checkcolor ${x1} ${y1} ${Hole1_R} ${Hole1_G} ${Hole1_B}
checkcolor ${x2} ${y2} ${Hole2_R} ${Hole2_G} ${Hole2_B}

View File

@ -12,8 +12,6 @@ vdrawtext Default 0.0 0.0 0.0 255 255 255 0 0 0 1 20 0
vdrawtext Right_Align 0.0 0.0 0.0 255 255 255 2 0 0 1 20 0
set scale 3.1783114563761763
set center_X 0
set center_Y 0
set proj_X 0.57735025882720947
set proj_Y -0.57735025882720947
set proj_Z 0.57735025882720947
@ -24,7 +22,7 @@ set at_X 0
set at_Y 0
set at_Z 0
vviewparams ${scale} ${center_X} ${center_Y} ${proj_X} ${proj_Y} ${proj_Z} ${up_X} ${up_Y} ${up_Z} ${at_X} ${at_Y} ${at_Z}
vviewparams -scale ${scale} -proj ${proj_X} ${proj_Y} ${proj_Z} -up ${up_X} ${up_Y} ${up_Z} -at ${at_X} ${at_Y} ${at_Z}
set x_coord 210
set y_coord 204

View File

@ -11,7 +11,7 @@ OCC280 0 0
# selected point
set x_coord 22
set y_coord 230
set y_coord 241
vfit

View File

@ -11,7 +11,7 @@ vsetdispmode b 1
OCC280 0 1
set x_coord 22
set y_coord 230
set y_coord 241
puts "Before View->FitAll()"

View File

@ -9,8 +9,6 @@ set y 208
set TypeOfMarker 0
set scale 50.0521
set center_X 0
set center_Y 0
set proj_X 0.57735
set proj_Y -0.57735
set proj_Z 0.57735
@ -21,7 +19,7 @@ set at_X 0
set at_Y 0
set at_Z 0
vviewparams ${scale} ${center_X} ${center_Y} ${proj_X} ${proj_Y} ${proj_Z} ${up_X} ${up_Y} ${up_Z} ${at_X} ${at_Y} ${at_Z}
vviewparams -scale ${scale} -proj ${proj_X} ${proj_Y} ${proj_Z} -up ${up_X} ${up_Y} ${up_Z} -at ${at_X} ${at_Y} ${at_Z}
OCC281 ${x} ${y} ${TypeOfMarker}
OCC281 ${x} ${y} ${TypeOfMarker}

View File

@ -25,19 +25,17 @@ vsetdispmode result 1
vfit
set scale 16.5593321780929
set center_X -0.0688543427812931
set center_Y 11.6346916159369
set proj_X 0.207536488771439
set proj_Y -0.233648166060448
set proj_Z 0.949914216995239
set up_X -0.857990384101868
set up_Y 0.422952175140381
set up_Z 0.291485607624054
set at_X 8.22575855255127
set at_Y -2.95449280738831
set at_Z 3.08669567108154
set at_X -1.78904829452738
set at_Y 1.90614280957802
set at_Z 6.47028180612483
vviewparams ${scale} ${center_X} ${center_Y} ${proj_X} ${proj_Y} ${proj_Z} ${up_X} ${up_Y} ${up_Z} ${at_X} ${at_Y} ${at_Z}
vviewparams -scale ${scale} -proj ${proj_X} ${proj_Y} ${proj_Z} -up ${up_X} ${up_Y} ${up_Z} -at ${at_X} ${at_Y} ${at_Z}
set info [trinfo result]
regexp { +([-0-9.+eE]+) +triangles} $info full tri

View File

@ -13,40 +13,40 @@ OCC280 1 0
vfit
set x1 135
set y1 170
set y1 119
set x2 314
set y2 97
set x2 387
set y2 33
set x3 172
set y3 184
set y3 144
set x4 32
set y4 241
set x4 28
set y4 190
set x5 156
set y5 263
set x5 160
set y5 257
set x6 305
set y6 186
set x6 365
set y6 150
set x7 186
set y7 280
set x7 212
set y7 272
set x8 54
set y8 342
set x8 60
set y8 343
set x9 32
set y9 286
set x9 26
set y9 255
set x10 295
set y10 142
set x10 353
set y10 99
set x11 322
set y11 153
set x11 389
set y11 113
set x12 56
set y12 305
set x12 60
set y12 276
#
# ___________2________________

View File

@ -13,40 +13,40 @@ OCC280 1 1
vfit
set x1 135
set y1 170
set y1 119
set x2 314
set y2 97
set x2 387
set y2 33
set x3 172
set y3 184
set y3 144
set x4 32
set y4 241
set x4 28
set y4 190
set x5 156
set y5 263
set x5 160
set y5 257
set x6 305
set y6 186
set x6 365
set y6 150
set x7 186
set y7 280
set x7 212
set y7 272
set x8 54
set y8 342
set x8 60
set y8 343
set x9 32
set y9 286
set x9 26
set y9 255
set x10 295
set y10 142
set x10 353
set y10 99
set x11 322
set y11 153
set x11 389
set y11 113
set x12 56
set y12 305
set x12 60
set y12 276
set Black_R 0
set Black_G 0

View File

@ -17,19 +17,17 @@ vsetdispmode 1
vfit
set scale 2.05374
set center_X 169.854
set center_Y -49.5549
set proj_X 0.135192
set proj_Y -0.978297
set proj_Z -0.157031
set up_X -0.399854
set up_Y -0.198875
set up_Z 0.894743
set at_X 241.985
set at_Y 329.911
set at_Z 390.356
set at_X 415.781529476262
set at_Y 349.647084890243
set at_Z 417.026634136105
vviewparams ${scale} ${center_X} ${center_Y} ${proj_X} ${proj_Y} ${proj_Z} ${up_X} ${up_Y} ${up_Z} ${at_X} ${at_Y} ${at_Z}
vviewparams -scale ${scale} -proj ${proj_X} ${proj_Y} ${proj_Z} -up ${up_X} ${up_Y} ${up_Z} -at ${at_X} ${at_Y} ${at_Z}
set x1 300
set y1 70

View File

@ -7,7 +7,7 @@ vselmode 2 1
vmoveto 102 204
vmoveto 110 352
vmoveto 0 0
vviewparams 6.063093 70.710655 40.824844 0.817216 -0.217801 0.535373 -0.420838 0.411627 0.808368 15.640388 -23.138439 18.852196
vviewparams -scale 6.063093 -proj 0.817216 -0.217801 0.535373 -up -0.420838 0.411627 0.808368 -at 26.4654518144607 56.2503832914726 34.5651685621603
vfit
vmoveto 0 0
vmoveto 92 231

View File

@ -7,7 +7,7 @@ vselmode 2 1
vmoveto 102 204
vmoveto 110 352
vmoveto 0 0
vviewparams 6.063093 70.710655 40.824844 0.817216 -0.217801 0.535373 -0.420838 0.411627 0.808368 15.640388 -23.138439 18.852196
vviewparams -scale 6.063093 -proj 0.817216 -0.217801 0.535373 -up -0.420838 0.411627 0.808368 -at 26.4654518144607 56.2503832914726 34.5651685621603
vfit
vmoveto 0 0
vmoveto 92 231

View File

@ -7,7 +7,7 @@ vselmode 2 1
vmoveto 102 204
vmoveto 110 352
vmoveto 0 0
vviewparams 6.063093 70.710655 40.824844 0.817216 -0.217801 0.535373 -0.420838 0.411627 0.808368 15.640388 -23.138439 18.852196
vviewparams -scale 6.063093 -proj 0.817216 -0.217801 0.535373 -up -0.420838 0.411627 0.808368 -at 26.4654518144607 56.2503832914726 34.5651685621603
vfit
vmoveto 0 0
vmoveto 92 231

View File

@ -7,7 +7,7 @@ vselmode 2 1
vmoveto 102 204
vmoveto 110 352
vmoveto 0 0
vviewparams 6.063093 70.710655 40.824844 0.817216 -0.217801 0.535373 -0.420838 0.411627 0.808368 15.640388 -23.138439 18.852196
vviewparams -scale 6.063093 -proj 0.817216 -0.217801 0.535373 -up -0.420838 0.411627 0.808368 -at 26.4654518144607 56.2503832914726 34.5651685621603
vfit
vmoveto 0 0
vmoveto 92 231
@ -15,7 +15,7 @@ vmoveto 120 350
vmoveto 0 0
vselect 120 350
vmoveto 0 0
vviewparams 6.063093 70.710655 41.047052 0.524772 0.731256 0.434393 0.716008 -0.104342 -0.691426 -40.284748 52.438004 4.063552
vviewparams -scale 6.063093 -proj 0.524772 0.731256 0.434393 -up 0.716008 -0.104342 -0.691426 -at 21.6212460112894 0.5192504580656 16.591446657356
vfit
vmoveto 0 0
vmoveto 144 350

View File

@ -7,7 +7,7 @@ vselmode 2 1
vmoveto 102 204
vmoveto 110 352
vmoveto 0 0
vviewparams 6.063093 70.710655 40.824844 0.817216 -0.217801 0.535373 -0.420838 0.411627 0.808368 15.640388 -23.138439 18.852196
vviewparams -scale 6.063093 -proj 0.817216 -0.217801 0.535373 -up -0.420838 0.411627 0.808368 -at 26.4654518144607 56.2503832914726 34.5651685621603
vfit
vmoveto 0 0
vmoveto 92 231
@ -15,7 +15,7 @@ vmoveto 120 350
vmoveto 0 0
vselect 120 350
vmoveto 0 0
vviewparams 6.063093 70.710655 41.047052 0.524772 0.731256 0.434393 0.716008 -0.104342 -0.691426 -40.284748 52.438004 4.063552
vviewparams -scale 6.063093 -proj 0.524772 0.731256 0.434393 -up 0.716008 -0.104342 -0.691426 -at 21.6212460112894 0.5192504580656 16.591446657356
vfit
vmoveto 0 0
vmoveto 144 350

View File

@ -7,7 +7,7 @@ vselmode 2 1
vmoveto 102 204
vmoveto 110 352
vmoveto 0 0
vviewparams 6.063093 70.710655 40.824844 0.817216 -0.217801 0.535373 -0.420838 0.411627 0.808368 15.640388 -23.138439 18.852196
vviewparams -scale 6.063093 -proj 0.817216 -0.217801 0.535373 -up -0.420838 0.411627 0.808368 -at 26.4654518144607 56.2503832914726 34.5651685621603
vfit
vmoveto 0 0
vmoveto 92 231
@ -15,7 +15,7 @@ vmoveto 120 350
vmoveto 0 0
vselect 120 350
vmoveto 0 0
vviewparams 6.063093 70.710655 41.047052 0.524772 0.731256 0.434393 0.716008 -0.104342 -0.691426 -40.284748 52.438004 4.063552
vviewparams -scale 6.063093 -proj 0.524772 0.731256 0.434393 -up 0.716008 -0.104342 -0.691426 -at 21.6212460112894 0.5192504580656 16.591446657356
vfit
vmoveto 0 0
vmoveto 144 350

View File

@ -7,7 +7,7 @@ vselmode 2 1
vmoveto 102 204
vmoveto 110 352
vmoveto 0 0
vviewparams 6.063093 70.710655 40.824844 0.817216 -0.217801 0.535373 -0.420838 0.411627 0.808368 15.640388 -23.138439 18.852196
vviewparams -scale 6.063093 -proj 0.817216 -0.217801 0.535373 -up -0.420838 0.411627 0.808368 -at 26.4654518144607 56.2503832914726 34.5651685621603
vfit
vmoveto 0 0
vmoveto 92 231
@ -15,7 +15,7 @@ vmoveto 120 350
vmoveto 0 0
vselect 120 350
vmoveto 0 0
vviewparams 6.063093 70.710655 41.047052 0.524772 0.731256 0.434393 0.716008 -0.104342 -0.691426 -40.284748 52.438004 4.063552
vviewparams -scale 6.063093 -proj 0.524772 0.731256 0.434393 -up 0.716008 -0.104342 -0.691426 -at 21.6212460112894 0.5192504580656 16.591446657356
vfit
vmoveto 0 0
vmoveto 144 350

View File

@ -7,7 +7,7 @@ vselmode 2 1
vmoveto 102 204
vmoveto 110 352
vmoveto 0 0
vviewparams 6.063093 70.710655 40.824844 0.817216 -0.217801 0.535373 -0.420838 0.411627 0.808368 15.640388 -23.138439 18.852196
vviewparams -scale 6.063093 -proj 0.817216 -0.217801 0.535373 -up -0.420838 0.411627 0.808368 -at 26.4654518144607 56.2503832914726 34.5651685621603
vfit
vmoveto 0 0
vmoveto 92 231
@ -15,7 +15,7 @@ vmoveto 120 350
vmoveto 0 0
vselect 120 350
vmoveto 0 0
vviewparams 6.063093 70.710655 41.047052 0.524772 0.731256 0.434393 0.716008 -0.104342 -0.691426 -40.284748 52.438004 4.063552
vviewparams -scale 6.063093 -proj 0.524772 0.731256 0.434393 -up 0.716008 -0.104342 -0.691426 -at 21.6212460112894 0.5192504580656 16.591446657356
vfit
vmoveto 0 0
vmoveto 144 350

View File

@ -18,7 +18,7 @@ vmoveto 29 204
vmoveto 0 0
vmoveto 204 306
vmoveto 0 0
vviewparams 6.063093 70.710655 40.824844 0.817216 -0.217801 0.535373 -0.420838 0.411627 0.808368 15.640388 -23.138439 18.852196
vviewparams -scale 6.063093 -proj 0.817216 -0.217801 0.535373 -up -0.420838 0.411627 0.808368 -at 26.4654518144607 56.2503832914726 34.5651685621603
vfit
vmoveto 0 0
vmoveto 185 110

View File

@ -18,7 +18,7 @@ vmoveto 29 204
vmoveto 0 0
vmoveto 204 306
vmoveto 0 0
vviewparams 6.063093 70.710655 40.824844 0.817216 -0.217801 0.535373 -0.420838 0.411627 0.808368 15.640388 -23.138439 18.852196
vviewparams -scale 6.063093 -proj 0.817216 -0.217801 0.535373 -up -0.420838 0.411627 0.808368 -at 26.4654518144607 56.2503832914726 34.5651685621603
vfit
vmoveto 0 0
vmoveto 185 110

View File

@ -18,7 +18,7 @@ vmoveto 29 204
vmoveto 0 0
vmoveto 204 306
vmoveto 0 0
vviewparams 6.063093 70.710655 40.824844 0.817216 -0.217801 0.535373 -0.420838 0.411627 0.808368 15.640388 -23.138439 18.852196
vviewparams -scale 6.063093 -proj 0.817216 -0.217801 0.535373 -up -0.420838 0.411627 0.808368 -at 26.4654518144607 56.2503832914726 34.5651685621603
vfit
vmoveto 0 0
vmoveto 185 110

View File

@ -18,7 +18,7 @@ vmoveto 29 204
vmoveto 0 0
vmoveto 204 306
vmoveto 0 0
vviewparams 6.063093 70.710655 40.824844 0.817216 -0.217801 0.535373 -0.420838 0.411627 0.808368 15.640388 -23.138439 18.852196
vviewparams -scale 6.063093 -proj 0.817216 -0.217801 0.535373 -up -0.420838 0.411627 0.808368 -at 26.4654518144607 56.2503832914726 34.5651685621603
vfit
vmoveto 0 0
vmoveto 185 110

View File

@ -18,7 +18,7 @@ vmoveto 29 204
vmoveto 0 0
vmoveto 204 306
vmoveto 0 0
vviewparams 6.063093 70.710655 40.824844 0.817216 -0.217801 0.535373 -0.420838 0.411627 0.808368 15.640388 -23.138439 18.852196
vviewparams -scale 6.063093 -proj 0.817216 -0.217801 0.535373 -up -0.420838 0.411627 0.808368 -at 26.4654518144607 56.2503832914726 34.5651685621603
vfit
vmoveto 0 0
vmoveto 185 110

View File

@ -18,7 +18,7 @@ vmoveto 29 204
vmoveto 0 0
vmoveto 204 306
vmoveto 0 0
vviewparams 6.063093 70.710655 40.824844 0.817216 -0.217801 0.535373 -0.420838 0.411627 0.808368 15.640388 -23.138439 18.852196
vviewparams -scale 6.063093 -proj 0.817216 -0.217801 0.535373 -up -0.420838 0.411627 0.808368 -at 26.4654518144607 56.2503832914726 34.5651685621603
vfit
vmoveto 0 0
vmoveto 185 110

View File

@ -18,7 +18,7 @@ vmoveto 29 204
vmoveto 0 0
vmoveto 204 306
vmoveto 0 0
vviewparams 6.063093 70.710655 40.824844 0.817216 -0.217801 0.535373 -0.420838 0.411627 0.808368 15.640388 -23.138439 18.852196
vviewparams -scale 6.063093 -proj 0.817216 -0.217801 0.535373 -up -0.420838 0.411627 0.808368 -at 26.4654518144607 56.2503832914726 34.5651685621603
vfit
vmoveto 0 0
vmoveto 185 110

View File

@ -18,7 +18,7 @@ vmoveto 29 204
vmoveto 0 0
vmoveto 204 306
vmoveto 0 0
vviewparams 6.063093 70.710655 40.824844 0.817216 -0.217801 0.535373 -0.420838 0.411627 0.808368 15.640388 -23.138439 18.852196
vviewparams -scale 6.063093 -proj 0.817216 -0.217801 0.535373 -up -0.420838 0.411627 0.808368 -at 26.4654518144607 56.2503832914726 34.5651685621603
vfit
vmoveto 0 0
vmoveto 185 110

View File

@ -18,7 +18,7 @@ vmoveto 29 204
vmoveto 0 0
vmoveto 204 306
vmoveto 0 0
vviewparams 6.063093 70.710655 40.824844 0.817216 -0.217801 0.535373 -0.420838 0.411627 0.808368 15.640388 -23.138439 18.852196
vviewparams -scale 6.063093 -proj 0.817216 -0.217801 0.535373 -up -0.420838 0.411627 0.808368 -at 26.4654518144607 56.2503832914726 34.5651685621603
vfit
vmoveto 0 0
vmoveto 185 110

View File

@ -18,7 +18,7 @@ vmoveto 29 204
vmoveto 0 0
vmoveto 204 306
vmoveto 0 0
vviewparams 6.063093 70.710655 40.824844 0.817216 -0.217801 0.535373 -0.420838 0.411627 0.808368 15.640388 -23.138439 18.852196
vviewparams -scale 6.063093 -proj 0.817216 -0.217801 0.535373 -up -0.420838 0.411627 0.808368 -at 26.4654518144607 56.2503832914726 34.5651685621603
vfit
vmoveto 0 0
vmoveto 185 110

View File

@ -18,7 +18,7 @@ vmoveto 29 204
vmoveto 0 0
vmoveto 204 306
vmoveto 0 0
vviewparams 6.063093 70.710655 40.824844 0.817216 -0.217801 0.535373 -0.420838 0.411627 0.808368 15.640388 -23.138439 18.852196
vviewparams -scale 6.063093 -proj 0.817216 -0.217801 0.535373 -up -0.420838 0.411627 0.808368 -at 26.4654518144607 56.2503832914726 34.5651685621603
vfit
vmoveto 0 0
vmoveto 185 110

View File

@ -18,7 +18,7 @@ vmoveto 29 204
vmoveto 0 0
vmoveto 204 306
vmoveto 0 0
vviewparams 6.063093 70.710655 40.824844 0.817216 -0.217801 0.535373 -0.420838 0.411627 0.808368 15.640388 -23.138439 18.852196
vviewparams -scale 6.063093 -proj 0.817216 -0.217801 0.535373 -up -0.420838 0.411627 0.808368 -at 26.4654518144607 56.2503832914726 34.5651685621603
vfit
vmoveto 0 0
vmoveto 185 110

View File

@ -18,7 +18,7 @@ vmoveto 29 204
vmoveto 0 0
vmoveto 204 306
vmoveto 0 0
vviewparams 6.063093 70.710655 40.824844 0.817216 -0.217801 0.535373 -0.420838 0.411627 0.808368 15.640388 -23.138439 18.852196
vviewparams -scale 6.063093 -proj 0.817216 -0.217801 0.535373 -up -0.420838 0.411627 0.808368 -at 26.4654518144607 56.2503832914726 34.5651685621603
vfit
vmoveto 0 0
vmoveto 185 110

View File

@ -18,7 +18,7 @@ vmoveto 29 204
vmoveto 0 0
vmoveto 204 306
vmoveto 0 0
vviewparams 6.063093 70.710655 40.824844 0.817216 -0.217801 0.535373 -0.420838 0.411627 0.808368 15.640388 -23.138439 18.852196
vviewparams -scale 6.063093 -proj 0.817216 -0.217801 0.535373 -up -0.420838 0.411627 0.808368 -at 26.4654518144607 56.2503832914726 34.5651685621603
vfit
vmoveto 0 0
vmoveto 185 110
@ -36,7 +36,7 @@ vmoveto 50 220
vmoveto 0 0
vmoveto 150 330
vmoveto 0 0
vviewparams 6.063093 70.710655 41.047052 0.524772 0.731256 0.434393 0.716008 -0.104342 -0.691426 -40.284748 52.438004 4.063552
vviewparams -scale 6.063093 -proj 0.524772 0.731256 0.434393 -up 0.716008 -0.104342 -0.691426 -at 21.6212460112894 0.5192504580656 16.591446657356
vfit
vmoveto 0 0
vmoveto 140 300

View File

@ -18,7 +18,7 @@ vmoveto 29 204
vmoveto 0 0
vmoveto 204 306
vmoveto 0 0
vviewparams 6.063093 70.710655 40.824844 0.817216 -0.217801 0.535373 -0.420838 0.411627 0.808368 15.640388 -23.138439 18.852196
vviewparams -scale 6.063093 -proj 0.817216 -0.217801 0.535373 -up -0.420838 0.411627 0.808368 -at 26.4654518144607 56.2503832914726 34.5651685621603
vfit
vmoveto 0 0
vmoveto 185 110
@ -36,7 +36,7 @@ vmoveto 50 220
vmoveto 0 0
vmoveto 150 330
vmoveto 0 0
vviewparams 6.063093 70.710655 41.047052 0.524772 0.731256 0.434393 0.716008 -0.104342 -0.691426 -40.284748 52.438004 4.063552
vviewparams -scale 6.063093 -proj 0.524772 0.731256 0.434393 -up 0.716008 -0.104342 -0.691426 -at 21.6212460112894 0.5192504580656 16.591446657356
vfit
vmoveto 0 0
vmoveto 140 300

View File

@ -18,7 +18,7 @@ vmoveto 29 204
vmoveto 0 0
vmoveto 204 306
vmoveto 0 0
vviewparams 6.063093 70.710655 40.824844 0.817216 -0.217801 0.535373 -0.420838 0.411627 0.808368 15.640388 -23.138439 18.852196
vviewparams -scale 6.063093 -proj 0.817216 -0.217801 0.535373 -up -0.420838 0.411627 0.808368 -at 26.4654518144607 56.2503832914726 34.5651685621603
vfit
vmoveto 0 0
vmoveto 185 110
@ -36,7 +36,7 @@ vmoveto 50 220
vmoveto 0 0
vmoveto 150 330
vmoveto 0 0
vviewparams 6.063093 70.710655 41.047052 0.524772 0.731256 0.434393 0.716008 -0.104342 -0.691426 -40.284748 52.438004 4.063552
vviewparams -scale 6.063093 -proj 0.524772 0.731256 0.434393 -up 0.716008 -0.104342 -0.691426 -at 21.6212460112894 0.5192504580656 16.591446657356
vfit
vmoveto 0 0
vmoveto 140 300

View File

@ -18,7 +18,7 @@ vmoveto 29 204
vmoveto 0 0
vmoveto 204 306
vmoveto 0 0
vviewparams 6.063093 70.710655 40.824844 0.817216 -0.217801 0.535373 -0.420838 0.411627 0.808368 15.640388 -23.138439 18.852196
vviewparams -scale 6.063093 -proj 0.817216 -0.217801 0.535373 -up -0.420838 0.411627 0.808368 -at 26.4654518144607 56.2503832914726 34.5651685621603
vfit
vmoveto 0 0
vmoveto 185 110
@ -36,7 +36,7 @@ vmoveto 50 220
vmoveto 0 0
vmoveto 150 330
vmoveto 0 0
vviewparams 6.063093 70.710655 41.047052 0.524772 0.731256 0.434393 0.716008 -0.104342 -0.691426 -40.284748 52.438004 4.063552
vviewparams -scale 6.063093 -proj 0.524772 0.731256 0.434393 -up 0.716008 -0.104342 -0.691426 -at 21.6212460112894 0.5192504580656 16.591446657356
vfit
vmoveto 0 0
vmoveto 140 300

View File

@ -18,7 +18,7 @@ vmoveto 29 204
vmoveto 0 0
vmoveto 204 306
vmoveto 0 0
vviewparams 6.063093 70.710655 40.824844 0.817216 -0.217801 0.535373 -0.420838 0.411627 0.808368 15.640388 -23.138439 18.852196
vviewparams -scale 6.063093 -proj 0.817216 -0.217801 0.535373 -up -0.420838 0.411627 0.808368 -at 26.4654518144607 56.2503832914726 34.5651685621603
vfit
vmoveto 0 0
vmoveto 185 110
@ -36,7 +36,7 @@ vmoveto 50 220
vmoveto 0 0
vmoveto 150 330
vmoveto 0 0
vviewparams 6.063093 70.710655 41.047052 0.524772 0.731256 0.434393 0.716008 -0.104342 -0.691426 -40.284748 52.438004 4.063552
vviewparams -scale 6.063093 -proj 0.524772 0.731256 0.434393 -up 0.716008 -0.104342 -0.691426 -at 21.6212460112894 0.5192504580656 16.591446657356
vfit
vmoveto 0 0
vmoveto 140 300

View File

@ -18,7 +18,7 @@ vmoveto 29 204
vmoveto 0 0
vmoveto 204 306
vmoveto 0 0
vviewparams 6.063093 70.710655 40.824844 0.817216 -0.217801 0.535373 -0.420838 0.411627 0.808368 15.640388 -23.138439 18.852196
vviewparams -scale 6.063093 -proj 0.817216 -0.217801 0.535373 -up -0.420838 0.411627 0.808368 -at 26.4654518144607 56.2503832914726 34.5651685621603
vfit
vmoveto 0 0
vmoveto 185 110
@ -36,7 +36,7 @@ vmoveto 50 220
vmoveto 0 0
vmoveto 150 330
vmoveto 0 0
vviewparams 6.063093 70.710655 41.047052 0.524772 0.731256 0.434393 0.716008 -0.104342 -0.691426 -40.284748 52.438004 4.063552
vviewparams -scale 6.063093 -proj 0.524772 0.731256 0.434393 -up 0.716008 -0.104342 -0.691426 -at 21.6212460112894 0.5192504580656 16.591446657356
vfit
vmoveto 0 0
vmoveto 140 300

View File

@ -18,7 +18,7 @@ vmoveto 29 204
vmoveto 0 0
vmoveto 204 306
vmoveto 0 0
vviewparams 6.063093 70.710655 40.824844 0.817216 -0.217801 0.535373 -0.420838 0.411627 0.808368 15.640388 -23.138439 18.852196
vviewparams -scale 6.063093 -proj 0.817216 -0.217801 0.535373 -up -0.420838 0.411627 0.808368 -at 26.4654518144607 56.2503832914726 34.5651685621603
vfit
vmoveto 0 0
vmoveto 185 110
@ -36,7 +36,7 @@ vmoveto 50 220
vmoveto 0 0
vmoveto 150 330
vmoveto 0 0
vviewparams 6.063093 70.710655 41.047052 0.524772 0.731256 0.434393 0.716008 -0.104342 -0.691426 -40.284748 52.438004 4.063552
vviewparams -scale 6.063093 -proj 0.524772 0.731256 0.434393 -up 0.716008 -0.104342 -0.691426 -at 21.6212460112894 0.5192504580656 16.591446657356
vfit
vmoveto 0 0
vmoveto 140 300

View File

@ -18,7 +18,7 @@ vmoveto 29 204
vmoveto 0 0
vmoveto 204 306
vmoveto 0 0
vviewparams 6.063093 70.710655 40.824844 0.817216 -0.217801 0.535373 -0.420838 0.411627 0.808368 15.640388 -23.138439 18.852196
vviewparams -scale 6.063093 -proj 0.817216 -0.217801 0.535373 -up -0.420838 0.411627 0.808368 -at 26.4654518144607 56.2503832914726 34.5651685621603
vfit
vmoveto 0 0
vmoveto 185 110
@ -36,7 +36,7 @@ vmoveto 50 220
vmoveto 0 0
vmoveto 150 330
vmoveto 0 0
vviewparams 6.063093 70.710655 41.047052 0.524772 0.731256 0.434393 0.716008 -0.104342 -0.691426 -40.284748 52.438004 4.063552
vviewparams -scale 6.063093 -proj 0.524772 0.731256 0.434393 -up 0.716008 -0.104342 -0.691426 -at 21.6212460112894 0.5192504580656 16.591446657356
vfit
vmoveto 0 0
vmoveto 140 300

View File

@ -18,7 +18,7 @@ vmoveto 29 204
vmoveto 0 0
vmoveto 204 306
vmoveto 0 0
vviewparams 6.063093 70.710655 40.824844 0.817216 -0.217801 0.535373 -0.420838 0.411627 0.808368 15.640388 -23.138439 18.852196
vviewparams -scale 6.063093 -proj 0.817216 -0.217801 0.535373 -up -0.420838 0.411627 0.808368 -at 26.4654518144607 56.2503832914726 34.5651685621603
vfit
vmoveto 0 0
vmoveto 185 110
@ -36,7 +36,7 @@ vmoveto 50 220
vmoveto 0 0
vmoveto 150 330
vmoveto 0 0
vviewparams 6.063093 70.710655 41.047052 0.524772 0.731256 0.434393 0.716008 -0.104342 -0.691426 -40.284748 52.438004 4.063552
vviewparams -scale 6.063093 -proj 0.524772 0.731256 0.434393 -up 0.716008 -0.104342 -0.691426 -at 21.6212460112894 0.5192504580656 16.591446657356
vfit
vmoveto 0 0
vmoveto 140 300

Some files were not shown because too many files have changed in this diff Show More