1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-04 18:06:22 +03:00

0023810: Cyclic dependency detected between the several OCCT units

Removed package Viewer. Methods and class filed from Viewer_View and Viewer_Viewer have been moved to V3d_View and V3d_Viewer
accordingly.
Removed Aspect_GraphicDriver.
V3d_View declaration fix
This commit is contained in:
dbv 2013-03-06 13:17:05 +04:00
parent 91c8d9f2e2
commit 6942f04af5
41 changed files with 296 additions and 526 deletions

View File

@ -223,7 +223,6 @@ p StdPrs
p StdSelect
p TColQuantity
p V3d
p Viewer
p Visual3d
p Voxel
p WNT

View File

@ -86,7 +86,6 @@ uses
Quantity,
TColQuantity,
Resource,
Viewer,
MMgt
is
@ -297,9 +296,6 @@ is
---Purpose: Creates and controles all identifiers.
---Category: Classes
deferred class GraphicDriver;
---Purpose: Defines a graphic driver (3d library)
class FontStyle;
---Purpose: Defines a Font Style
---Category: The classes

View File

@ -26,7 +26,6 @@ uses
TypeOfColorScalePosition from Aspect,
ColorMap from Aspect,
SequenceOfColor from Aspect,
View from Viewer,
Color from Quantity,
AsciiString from TCollection,
ExtendedString from TCollection,

View File

@ -1,28 +0,0 @@
-- Created on: 1997-01-28
-- Created by: CAL
-- Copyright (c) 1997-1999 Matra Datavision
-- Copyright (c) 1999-2012 OPEN CASCADE SAS
--
-- The content of this file is subject to the Open CASCADE Technology Public
-- License Version 6.5 (the "License"). You may not use the content of this file
-- except in compliance with the License. Please obtain a copy of the License
-- at http://www.opencascade.org and read it completely before using this file.
--
-- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
-- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
--
-- The Original Code and all software distributed under the License is
-- distributed on an "AS IS" basis, without warranty of any kind, and the
-- Initial Developer hereby disclaims all such warranties, including without
-- limitation, any warranties of merchantability, fitness for a particular
-- purpose or non-infringement. Please see the License for the specific terms
-- and conditions governing the rights and limitations under the License.
deferred class GraphicDriver from Aspect inherits TShared
is
Initialize;
end GraphicDriver from Aspect;

View File

@ -1,27 +0,0 @@
// Created on: 1997-01-28
// Created by: CAL
// Copyright (c) 1997-1999 Matra Datavision
// Copyright (c) 1999-2012 OPEN CASCADE SAS
//
// The content of this file is subject to the Open CASCADE Technology Public
// License Version 6.5 (the "License"). You may not use the content of this file
// except in compliance with the License. Please obtain a copy of the License
// at http://www.opencascade.org and read it completely before using this file.
//
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
//
// The Original Code and all software distributed under the License is
// distributed on an "AS IS" basis, without warranty of any kind, and the
// Initial Developer hereby disclaims all such warranties, including without
// limitation, any warranties of merchantability, fitness for a particular
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
#include <Aspect_GraphicDriver.ixx>
Aspect_GraphicDriver::Aspect_GraphicDriver () {
}

View File

@ -18,7 +18,7 @@
-- purpose or non-infringement. Please see the License for the specific terms
-- and conditions governing the rights and limitations under the License.
deferred class GraphicDriver from Graphic3d inherits GraphicDriver from Aspect
deferred class GraphicDriver from Graphic3d inherits TShared
---Version:
@ -51,7 +51,6 @@ uses
Array1OfEdge from Aspect,
CLayer2d from Aspect,
GraphicDriver from Aspect,
TypeOfTriedronEcho from Aspect,
TypeOfTriedronPosition from Aspect,
Handle from Aspect,

View File

@ -40,7 +40,7 @@ uses
TopLoc,
Prs3d,Graphic3d,
Quantity,Geom,
Viewer,
V3d,
TColStd,
gp

View File

@ -30,7 +30,7 @@ inherits TShared from MMgt
uses
Presentation from PrsMgr,
PresentableObject from PrsMgr,
View from Viewer,
View from V3d,
ListOfTransient from TColStd
@ -151,7 +151,7 @@ is
-- aPresentableObject with the mode aMode from the
-- list of objects in immediate mode.
EndDraw(me: mutable; aView: View from Viewer; DoubleBuffer: Boolean from Standard = Standard_False)
EndDraw(me: mutable; aView: View from V3d; DoubleBuffer: Boolean from Standard = Standard_False)
---Purpose: Allows rapid drawing of the view aView by avoiding
-- an update of the whole background. If DoubleBuffer
-- is true, the background is drawn.

View File

@ -49,7 +49,7 @@ uses
--NameOfPhysicalMaterial from Graphic3d,
Presentation from PrsMgr,
Presentation3d from PrsMgr,
View from Viewer,
View from V3d,
ShadingAspect from Prs3d,
Presentation from Prs3d
is
@ -88,7 +88,7 @@ is
---Purpose: stores <aPrs> in a list of structure to be displayed
-- in immediate mode. will be taken in account in EndDraw Method.
EndDraw(me: mutable; aView: View from Viewer; DoubleBuffer: Boolean from Standard = Standard_False)
EndDraw(me: mutable; theView: View from V3d; DoubleBuffer: Boolean from Standard = Standard_False)
is redefined static;

View File

@ -162,12 +162,9 @@ void PrsMgr_PresentationManager3d::BeginDraw()
//purpose :
//=======================================================================
void PrsMgr_PresentationManager3d::EndDraw(const Handle(Viewer_View)& aView, const Standard_Boolean DoubleBuffer) {
Handle(V3d_View) v;
v =*((Handle(V3d_View)*)&aView);
if (!v->TransientManagerBeginDraw(DoubleBuffer,Standard_True))
void PrsMgr_PresentationManager3d::EndDraw(const Handle(V3d_View)& theView, const Standard_Boolean DoubleBuffer)
{
if (!theView->TransientManagerBeginDraw (DoubleBuffer, Standard_True))
{
myImmediateMode = Standard_False;
return;

View File

@ -1,7 +1,6 @@
Aspect
InterfaceGraphic
SelectBasics
Viewer
Xw
AlienImage
Image
@ -10,4 +9,3 @@ WNT
Cocoa
TColQuantity
Font

View File

@ -47,7 +47,6 @@ package V3d
uses
Viewer,
TColStd,
Graphic3d,
Visual3d,
@ -77,6 +76,7 @@ is
--Category: The Exceptions
--------------------------
exception BadValue inherits OutOfRange;
exception UnMapped inherits DomainError;
-----------------------------
@ -181,7 +181,7 @@ is
class Viewer;
---Purpose: Provides the services of a 3D viewer.
deferred class View;
class View;
---Purpose: Provides a set of services common to all types of view.
class OrthographicView;

View File

@ -44,7 +44,7 @@ uses
Group from Graphic3d,
View from V3d
raises BadValue from Viewer
raises BadValue from V3d
is
@ -76,11 +76,11 @@ is
---Purpose : Defines the direction of the light source
-- by a predefined orientation.
SetDirection ( me : mutable; Xm, Ym, Zm : Parameter ) raises BadValue from Viewer is static;
SetDirection ( me : mutable; Xm, Ym, Zm : Parameter ) raises BadValue from V3d is static;
---Level: Public
---Purpose : Defines the direction of the light source by the predefined
-- vector Xm,Ym,Zm.
-- Warning: raises BadValue from Viewer if the vector is null.
-- Warning: raises BadValue from V3d if the vector is null.
SetDisplayPosition (me : mutable; X,Y,Z : Coordinate) is static;
---Level: Public

View File

@ -54,7 +54,7 @@
#include <Visual3d_PickDescriptor.hxx>
#include <Visual3d_HSequenceOfPickPath.hxx>
#include <Visual3d_PickPath.hxx>
#include <Viewer_BadValue.hxx>
#include <V3d_BadValue.hxx>
#include <gp_Dir.hxx>
#include <gp_Ax1.hxx>
#include <gp_Vec.hxx>
@ -105,7 +105,7 @@ void V3d_DirectionalLight::SetDirection(const V3d_TypeOfOrientation Direction) {
void V3d_DirectionalLight::SetDirection(const Standard_Real Vx, const Standard_Real Vy, const Standard_Real Vz) {
Viewer_BadValue_Raise_if( sqrt( Vx*Vx + Vy*Vy + Vz*Vz ) <= 0.,"V3d_DirectionalLight::SetDirection, null vector" );
V3d_BadValue_Raise_if( sqrt( Vx*Vx + Vy*Vy + Vz*Vz ) <= 0.,"V3d_DirectionalLight::SetDirection, null vector" );
Graphic3d_Vector V(Vx,Vy,Vz) ;
V.Normalize() ;

View File

@ -53,7 +53,7 @@ uses
Structure from Graphic3d
raises
BadValue from Viewer
BadValue from V3d
is

View File

@ -39,7 +39,7 @@ uses
raises
BadValue from Viewer
BadValue from V3d
is
@ -86,8 +86,8 @@ is
-- TAN(Angle/2) = Size/Length
-- Size expresses the smallest dimension of the window.
-- Length expresses the focal length.
raises BadValue from Viewer
---Purpose: Warning! raises BadValue from Viewer
raises BadValue from V3d
---Purpose: Warning! raises BadValue from V3d
-- if the opening angle is <= 0 or >= PI
is static;
@ -102,7 +102,7 @@ is
-- angle of opening of the perspective in RADIANS,
-- aspect ratio of window width to its height and
-- near and far clipping planes
raises BadValue from Viewer
raises BadValue from V3d
-- if the opening angle is <= 0 or >= PI or
-- the ZNear<0, ZFar<0 or ZNear>=Zfar.
is static;

View File

@ -45,7 +45,7 @@
#include <V3d_View.hxx>
#include <V3d_PerspectiveView.ixx>
#include <Visual3d_View.hxx>
#include <Viewer_BadValue.hxx>
#include <V3d_BadValue.hxx>
V3d_PerspectiveView::V3d_PerspectiveView (const Handle(V3d_Viewer)& VM):V3d_View (VM,V3d_PERSPECTIVE) {
MyViewMapping.SetProjection(Visual3d_TOP_PERSPECTIVE) ;
@ -79,7 +79,7 @@ void V3d_PerspectiveView::SetAngle(const Standard_Real Angle) {
Standard_Real focale,Umin,Vmin,Umax,Vmax,Dxv,Dyv,Rap,Xrp,Yrp;
Viewer_BadValue_Raise_if ( Angle <= 0. || Angle >= M_PI, "V3d_PerspectiveView::SetAngle, bad angle");
V3d_BadValue_Raise_if ( Angle <= 0. || Angle >= M_PI, "V3d_PerspectiveView::SetAngle, bad angle");
MyViewMapping.WindowLimit(Umin,Vmin,Umax,Vmax) ;
Dxv = Abs(Umax - Umin)/2. ; Dyv = Abs(Vmax - Vmin)/2.;
@ -125,8 +125,8 @@ void V3d_PerspectiveView::SetPerspective(const Standard_Real Angle, const Standa
{
Standard_Real Umin,Vmin,Umax,Vmax,Xrp,Yrp,Zrp,du,dv;
Viewer_BadValue_Raise_if ( ZNear <= 0. || ZFar <= 0. || ZNear >= ZFar, "V3d_PerspectiveView::SetPerspective, bad distances");
Viewer_BadValue_Raise_if ( Angle <= 0. || Angle >= M_PI, "V3d_PerspectiveView::SetAngle, bad angle");
V3d_BadValue_Raise_if ( ZNear <= 0. || ZFar <= 0. || ZNear >= ZFar, "V3d_PerspectiveView::SetPerspective, bad distances");
V3d_BadValue_Raise_if ( Angle <= 0. || Angle >= M_PI, "V3d_PerspectiveView::SetAngle, bad angle");
Graphic3d_Vertex PRP = MyViewMapping.ProjectionReferencePoint() ;
Xrp = Yrp = Zrp = 0.;

View File

@ -45,7 +45,7 @@ uses
raises
BadValue from Viewer
BadValue from V3d
is
@ -61,8 +61,8 @@ is
---Level : Public
---Purpose: Creates a clipping plane using the equation :
-- <A>*X + <B>*Y + <C>*Z + <D> = 0.0
raises BadValue from Viewer;
---Purpose: Warning! raises BadValue from Viewer
raises BadValue from V3d;
---Purpose: Warning! raises BadValue from V3d
-- if the norm of the plane is NULL.
--------------------------------------------------------
@ -72,8 +72,8 @@ is
SetPlane( me : mutable; A,B,C,D : Parameter)
---Level : Public
---Purpose: Modifies the plane equation.
raises BadValue from Viewer
---Purpose: Warning! raises BadValue from Viewer
raises BadValue from V3d
---Purpose: Warning! raises BadValue from V3d
-- if the norm of the plane is NULL.
-- If the norm of the plane is NULL.
is static;

View File

@ -31,7 +31,7 @@
#include <V3d.hxx>
#include <V3d_Plane.ixx>
#include <Viewer_BadValue.hxx>
#include <V3d_BadValue.hxx>
#include <Graphic3d_Group.hxx>
#include <Graphic3d_ArrayOfQuadrangles.hxx>
@ -42,7 +42,7 @@
V3d_Plane::V3d_Plane(const Standard_Real A, const Standard_Real B, const Standard_Real C, const Standard_Real D)
{
Viewer_BadValue_Raise_if( sqrt(A*A + B*B + C*C) <= 0., "V3d_Plane::V3d_Plane, bad plane coefficients");
V3d_BadValue_Raise_if( sqrt(A*A + B*B + C*C) <= 0., "V3d_Plane::V3d_Plane, bad plane coefficients");
MyPlane = new Visual3d_ClipPlane(A,B,C,D) ;
}
@ -51,7 +51,7 @@ V3d_Plane::V3d_Plane(const Standard_Real A, const Standard_Real B, const Standar
void V3d_Plane::SetPlane(const Standard_Real A, const Standard_Real B, const Standard_Real C, const Standard_Real D)
{
Viewer_BadValue_Raise_if( sqrt(A*A + B*B + C*C) <= 0., "V3d_Plane::SetPlane, bad plane coefficients");
V3d_BadValue_Raise_if( sqrt(A*A + B*B + C*C) <= 0., "V3d_Plane::SetPlane, bad plane coefficients");
MyPlane->SetPlane(A,B,C,D) ;
if( IsDisplayed() )

View File

@ -42,7 +42,7 @@ uses
Vertex from Graphic3d,
Group from Graphic3d
raises BadValue from Viewer
raises BadValue from V3d
is
@ -61,10 +61,10 @@ is
---Purpose: Defines the target of the light (the center
-- of the sphere)
SetRadius ( me : mutable; Radius : Parameter) raises BadValue from Viewer is static;
SetRadius ( me : mutable; Radius : Parameter) raises BadValue from V3d is static;
---Level: Public
---Purpose: Define the radius.
---Warning: raises BadValue from Viewer if the radius is <= 0 or if the light is directional
---Warning: raises BadValue from V3d if the radius is <= 0 or if the light is directional
OnHideFace (me : mutable; aView : View from V3d);
---Level: Public

View File

@ -39,7 +39,7 @@
#include <Visual3d_PickDescriptor.hxx>
#include <Visual3d_HSequenceOfPickPath.hxx>
#include <Visual3d_PickPath.hxx>
#include <Viewer_BadValue.hxx>
#include <V3d_BadValue.hxx>
#include <gp_Dir.hxx>
#include <gp_Ax1.hxx>
#include <gp_Vec.hxx>
@ -74,8 +74,8 @@ void V3d_PositionLight::SetTarget(const Standard_Real X, const Standard_Real Y,
void V3d_PositionLight::SetRadius(const Standard_Real Radius) {
Viewer_BadValue_Raise_if( Radius <= 0. , "V3d_PositionLight::SetRadius, bad radius");
Viewer_BadValue_Raise_if( MyType == V3d_DIRECTIONAL , "V3d_PositionLight::SetRadius, bad light type");
V3d_BadValue_Raise_if( Radius <= 0. , "V3d_PositionLight::SetRadius, bad radius");
V3d_BadValue_Raise_if( MyType == V3d_DIRECTIONAL , "V3d_PositionLight::SetRadius, bad light type");
Standard_Real X0,Y0,Z0, Xn,Yn,Zn, Xp,Yp,Zp;

View File

@ -51,7 +51,7 @@ uses
Vertex from Graphic3d,
Group from Graphic3d
raises BadValue from Viewer
raises BadValue from V3d
is
@ -71,8 +71,8 @@ is
-- A1,A2 being the two factors of attenuation
-- Length is the distance of the isolated source
-- from the surface.
raises BadValue from Viewer;
---Purpose: Warning! raises BadValue from Viewer
raises BadValue from V3d;
---Purpose: Warning! raises BadValue from V3d
-- if one of the attenuation coefficients is not between 0 et 1.
Create ( VM : mutable Viewer ; Xt,Yt,Zt : Coordinate;
@ -93,8 +93,8 @@ is
-- F = 1/(A1 + A2*Length) where:
-- - A1,A2 are the two attenuation factors, and
-- - Length is the distance from the isolated source.
raises BadValue from Viewer;
---Purpose: Warning! raises BadValue from Viewer
raises BadValue from V3d;
---Purpose: Warning! raises BadValue from V3d
-- if one of the attenuation coefficients is not between 0 et 1.
@ -106,10 +106,10 @@ is
---Level: Public
---Purpose: Defines the position of the light source.
SetAttenuation( me : mutable; A1,A2 : Coefficient ) raises BadValue from Viewer is static;
SetAttenuation( me : mutable; A1,A2 : Coefficient ) raises BadValue from V3d is static;
---Level: Public
---Purpose: Defines the attenuation factors.
-- Warning: raises BadValue from Viewer
-- Warning: raises BadValue from V3d
-- if one of the attenuation coefficients is not between 0 et 1.
---------------------------------------------------

View File

@ -54,7 +54,7 @@
#include <Visual3d_PickDescriptor.hxx>
#include <Visual3d_HSequenceOfPickPath.hxx>
#include <Visual3d_PickPath.hxx>
#include <Viewer_BadValue.hxx>
#include <V3d_BadValue.hxx>
#include <gp_Dir.hxx>
#include <gp_Ax1.hxx>
#include <gp_Vec.hxx>
@ -74,7 +74,7 @@ V3d_PositionalLight::V3d_PositionalLight(const Handle(V3d_Viewer)& VM, const Sta
Graphic3d_Vertex P(X,Y,Z) ;
Graphic3d_Vertex T(0.,0.,0.);
Viewer_BadValue_Raise_if ( A1 < 0 || A1 > 1. || A2 < 0 || A2 > 1,
V3d_BadValue_Raise_if ( A1 < 0 || A1 > 1. || A2 < 0 || A2 > 1,
"V3d_PositionalLight, bad coefficients");
MyType = V3d_POSITIONAL ;
@ -89,7 +89,7 @@ V3d_PositionalLight::V3d_PositionalLight(const Handle(V3d_Viewer)& VM, const Sta
Graphic3d_Vertex T(Xt,Yt,Zt) ;
Graphic3d_Vertex P(Xp,Yp,Zp) ;
Viewer_BadValue_Raise_if ( A1 < 0 || A1 > 1. || A2 < 0 || A2 > 1,
V3d_BadValue_Raise_if ( A1 < 0 || A1 > 1. || A2 < 0 || A2 > 1,
"V3d_PositionalLight, bad coefficients");
MyType = V3d_POSITIONAL ;
@ -108,7 +108,7 @@ void V3d_PositionalLight::SetPosition(const Standard_Real Xp, const Standard_Rea
void V3d_PositionalLight::SetAttenuation(const Standard_Real A1, const Standard_Real A2) {
Viewer_BadValue_Raise_if ( A1 < 0 || A1 > 1. || A2 < 0 || A2 > 1,
V3d_BadValue_Raise_if ( A1 < 0 || A1 > 1. || A2 < 0 || A2 > 1,
"V3d_PositionalLight::SetAttenuation, bad coefficients");
MyLight->SetAttenuation1(A1) ;

View File

@ -45,7 +45,7 @@ uses
Vertex from Graphic3d,
Group from Graphic3d
raises BadValue from Viewer
raises BadValue from V3d
is
@ -69,8 +69,8 @@ is
-- The concentration factor determines the dispersion
-- of the light on the surface, the default value
-- (1.0) corresponds to a minimum of dispersion .
raises BadValue from Viewer;
---Purpose: Warning! raises BadValue from Viewer -
raises BadValue from V3d;
---Purpose: Warning! raises BadValue from V3d -
-- If one of the coefficients is not between 0 and 1 .
-- If the lighting angle is <= 0 ou > PI .
@ -87,8 +87,8 @@ is
-- Xt,Yt,Zt : Coordinate of light source Target.
-- Xp,Yp,Zp : Coordinate of light source Position.
-- The others parameters describe before.
raises BadValue from Viewer;
---Purpose: Warning! raises BadValue from Viewer -
raises BadValue from V3d;
---Purpose: Warning! raises BadValue from V3d -
-- If one of the coefficients is not between 0 and 1 .
-- If the lighting angle is <= 0 ou > PI .
@ -100,7 +100,7 @@ is
---Level: Public
---Purpose: Defines the position of the light source.
SetDirection ( me : mutable; Vx, Vy, Vz : Parameter ) raises BadValue from Viewer is static;
SetDirection ( me : mutable; Vx, Vy, Vz : Parameter ) raises BadValue from V3d is static;
---Level: Public
---Purpose : Defines the direction of the light source.
-- If the normal vector is NULL.
@ -110,21 +110,21 @@ is
---Purpose : Defines the direction of the light source
-- according to a predefined directional vector.
SetAttenuation( me : mutable; A1,A2 : Coefficient ) raises BadValue from Viewer is static;
SetAttenuation( me : mutable; A1,A2 : Coefficient ) raises BadValue from V3d is static;
---Level: Public
---Purpose: Defines the coefficients of attenuation.
-- Warning! raises BadValue from Viewer
-- Warning! raises BadValue from V3d
-- if one of the coefficient is <0 ou >1 .
SetConcentration( me : mutable; C : Coefficient ) raises BadValue from Viewer is static;
SetConcentration( me : mutable; C : Coefficient ) raises BadValue from V3d is static;
---Level: Public
---Purpose: Defines the coefficient of concentration.
-- if the coefficient is <0 ou >1 .
SetAngle ( me : mutable; Angle : PlaneAngle ) raises BadValue from Viewer is static;
SetAngle ( me : mutable; Angle : PlaneAngle ) raises BadValue from V3d is static;
---Level: Public
---Purpose: Defines the spot angle in RADIANS.
-- Warning: raises BadValue from from Viewer
-- Warning: raises BadValue from from V3d
-- If the angle is <= 0 ou > PI .
---------------------------------------------------

View File

@ -67,7 +67,7 @@
V3d_SpotLight::V3d_SpotLight(const Handle(V3d_Viewer)& VM, const Standard_Real X, const Standard_Real Y, const Standard_Real Z, const V3d_TypeOfOrientation Direction, const Quantity_NameOfColor Name, const Standard_Real A1, const Standard_Real A2, const Standard_Real CN, const Standard_Real AN):V3d_PositionLight(VM) {
Viewer_BadValue_Raise_if( A1 < 0 || A1 > 1. || A2 < 0 || A2 > 1
V3d_BadValue_Raise_if( A1 < 0 || A1 > 1. || A2 < 0 || A2 > 1
|| AN < 0. || AN > M_PI, "V3d_SpotLight, bad coefficient or angle");
Quantity_Color C(Name) ;
@ -84,7 +84,7 @@ V3d_SpotLight::V3d_SpotLight(const Handle(V3d_Viewer)& VM, const Standard_Real X
V3d_SpotLight::V3d_SpotLight(const Handle(V3d_Viewer)& VM, const Standard_Real Xt, const Standard_Real Yt, const Standard_Real Zt, const Standard_Real Xp, const Standard_Real Yp, const Standard_Real Zp, const Quantity_NameOfColor Name, const Standard_Real A1, const Standard_Real A2, const Standard_Real CN, const Standard_Real AN):V3d_PositionLight(VM) {
Viewer_BadValue_Raise_if( A1 < 0 || A1 > 1. || A2 < 0 || A2 > 1
V3d_BadValue_Raise_if( A1 < 0 || A1 > 1. || A2 < 0 || A2 > 1
|| AN < 0. || AN > M_PI, "V3d_SpotLight, bad coefficient or angle");
Quantity_Color C(Name) ;
@ -121,7 +121,7 @@ void V3d_SpotLight::SetDirection(const V3d_TypeOfOrientation Direction) {
void V3d_SpotLight::SetAttenuation(const Standard_Real A1, const Standard_Real A2) {
Viewer_BadValue_Raise_if( A1 < 0 || A1 > 1. || A2 < 0 || A2 > 1 ,
V3d_BadValue_Raise_if( A1 < 0 || A1 > 1. || A2 < 0 || A2 > 1 ,
"V3d_SpotLight::SetAttenuation, bad coefficients");
MyLight->SetAttenuation1(A1) ;
@ -131,7 +131,7 @@ void V3d_SpotLight::SetAttenuation(const Standard_Real A1, const Standard_Real A
void V3d_SpotLight::SetConcentration(const Standard_Real C) {
Viewer_BadValue_Raise_if( C < 0 || C > 1.,
V3d_BadValue_Raise_if( C < 0 || C > 1.,
"V3d_SpotLight::SetConcentration, bad coefficient");
MyLight->SetConcentration(C) ;
@ -139,7 +139,7 @@ void V3d_SpotLight::SetConcentration(const Standard_Real C) {
void V3d_SpotLight::SetAngle(const Standard_Real Angle) {
Viewer_BadValue_Raise_if( Angle <= 0. || Angle >= M_PI,
V3d_BadValue_Raise_if( Angle <= 0. || Angle >= M_PI,
"V3d_SpotLight::SetAngle, bad angle");
MyLight->SetAngle(Angle) ;

View File

@ -64,7 +64,7 @@
-- NKV - 23/07/07 -> Define custom projection and model view matrixes
-- NKV - 08/02/07 -> Add ConvertWithProj() method
deferred class View from V3d
class View from V3d inherits TShared from MMgt
---Purpose: Defines the application object VIEW for the
-- VIEWER application.
@ -83,11 +83,6 @@ deferred class View from V3d
-- View->Move(10.,20.,0.,True) (Starting motion)
-- View->Move(15.,-5.,0.,False) (Next motion)
inherits
View from Viewer
uses
-- S3892
@ -155,15 +150,15 @@ uses
raises
BadValue from Viewer, TypeMismatch from Standard,
BadValue from V3d, TypeMismatch from Standard,
MultiplyDefined from Standard,UnMapped from V3d
is
Initialize ( VM : mutable Viewer; Type : TypeOfView from V3d = V3d_ORTHOGRAPHIC );
Create ( VM : mutable Viewer; Type : TypeOfView from V3d = V3d_ORTHOGRAPHIC );
---Purpose: Initialises the view.
Initialize ( VM : mutable Viewer ; V : View from V3d; Type : TypeOfView from V3d = V3d_ORTHOGRAPHIC );
Create ( VM : mutable Viewer ; V : View from V3d; Type : TypeOfView from V3d = V3d_ORTHOGRAPHIC );
---Purpose: Initialises the view by copying.
--------------------------------------------------------
@ -210,7 +205,7 @@ is
---Level: Public
---Purpose: Destroys the view.
Update ( me ) is redefined static;
Update ( me ) is static;
---Level: Public
---Purpose: Deprecated, Redraw() should be used instead.
@ -323,8 +318,8 @@ is
---Purpose: Definition of an axis from its origin and
-- its orientation .
-- This will be the current axis for rotations and movements.
raises BadValue from Viewer;
---Purpose: Warning! raises BadValue from Viewer if the vector normal is NULL. .
raises BadValue from V3d;
---Purpose: Warning! raises BadValue from V3d if the vector normal is NULL. .
SetShadingModel ( me : mutable; Model : TypeOfShadingModel );
---Level: Public
@ -362,7 +357,7 @@ is
SetZClippingWidth ( me : mutable; Width : Length )
---Level: Public
---Purpose: Defines the thicknes around the medium clippling plane. .
raises BadValue from Viewer;
raises BadValue from V3d;
-- If the thickness is <= 0
SetZClippingType ( me : mutable; Type : TypeOfZclipping );
@ -376,7 +371,7 @@ is
SetZCueingWidth ( me : mutable; Width : Length )
---Level: Public
---Purpose: Defines the thickness around the medium plane.
raises BadValue from Viewer;
raises BadValue from V3d;
-- If thickness is <= 0
SetZCueingOn ( me : mutable );
@ -390,13 +385,13 @@ is
SetLightOn( me : mutable ; MyLight : Light from V3d )
---Level: Public
---Purpose: Activates MyLight in the view.
raises BadValue from Viewer;
raises BadValue from V3d;
-- If No More Light can be activated in MyView .
SetLightOn( me : mutable )
---Level: Public
---Purpose: Activates all the lights defined in this view.
raises BadValue from Viewer;
raises BadValue from V3d;
-- If No More Light can be activated in MyView .
SetLightOff( me : mutable ; MyLight : Light from V3d );
@ -419,14 +414,14 @@ is
SetPlaneOn( me : mutable ; MyPlane : Plane from V3d )
---Level: Public
---Purpose: Activates the clipping plane in this view.
raises BadValue from Viewer ;
raises BadValue from V3d ;
---Purpose: If No More Plane can be activated in MyView .
SetPlaneOn( me : mutable )
---Level: Public
---Purpose: Activate all the clipping planes defined in
-- this view.
raises BadValue from Viewer;
raises BadValue from V3d;
---Purpose: If No More Plane can be activated in MyView .
SetPlaneOff( me : mutable ; MyPlane : Plane from V3d );
@ -443,6 +438,11 @@ is
returns Boolean from Standard;
---Level: Public
---Purpose: Returns TRUE when the plane is active in this view.
SetImmediateUpdate(me: mutable; theImmediateUpdate: Boolean from Standard)
returns Boolean from Standard;
---Purpose: sets the immediate update mode and returns the previous one.
---------------------------------------------------
-- Triedron methods
@ -638,8 +638,8 @@ is
-- for which the origin is the view point of the projection,
-- with a relative angular value in RADIANS with respect to
-- the initial position expressed by Start = Standard_True
raises BadValue from Viewer;
---Purpose: Warning! raises BadValue from Viewer
raises BadValue from V3d;
---Purpose: Warning! raises BadValue from V3d
-- If the eye, the view point, or the high point are
-- aligned or confused.
@ -652,7 +652,7 @@ is
-- for which the origin is Gravity point {X,Y,Z},
-- with a relative angular value in RADIANS with respect to
-- the initial position expressed by Start = Standard_True
raises BadValue from Viewer;
raises BadValue from V3d;
---Purpose: If the eye, the view point, or the high point are
-- aligned or confused.
@ -688,7 +688,7 @@ is
---Purpose: Movement of the eye parallel to the coordinate system
-- of reference of the screen a distance relative to the
-- initial position expressed by Start = Standard_True.
raises BadValue from Viewer;
raises BadValue from V3d;
-- If the eye, the view point, or the high point are
-- aligned or confused.
@ -699,7 +699,7 @@ is
-- coordinate system of reference of the view a distance
-- relative to the initial position expressed by
-- Start = Standard_True.
raises BadValue from Viewer;
raises BadValue from V3d;
-- If the eye, view point, or high point are aligned or confused.
Move ( me : mutable ; Length : Length ;
@ -708,7 +708,7 @@ is
---Purpose: Movement of the eye parllel to the current axis
-- a distance relative to the initial position
-- expressed by Start = Standard_True
raises BadValue from Viewer;
raises BadValue from V3d;
-- If the eye, view point, or high point are aligned or confused.
Translate ( me : mutable ; Dx,Dy,Dz : Length ;
@ -718,7 +718,7 @@ is
-- frame of reference of the screen a distance relative
-- to the initial position expressed by
-- Start = Standard_True
raises BadValue from Viewer;
raises BadValue from V3d;
-- If the eye, view point, or high point are aligned or confused.
Translate ( me : mutable ; Axe : TypeOfAxe ; Length : Length ;
@ -742,7 +742,7 @@ is
---Purpose: places the point of the view corresponding
-- at the pixel position x,y at the center of the window
-- and updates the view.
is redefined static;
is static;
Turn ( me : mutable ; Ax,Ay,Az : PlaneAngle ;
Start : Boolean = Standard_True )
@ -752,7 +752,7 @@ is
-- projection with a relative angular value in RADIANS
-- with respect to the initial position expressed by
-- Start = Standard_True
raises BadValue from Viewer;
raises BadValue from V3d;
-- If the eye, view point, or high point are aligned or confused.
Turn ( me : mutable ; Axe : TypeOfAxe ; Angle : PlaneAngle ;
@ -778,51 +778,51 @@ is
-- the reference frame of the view with respect to the
-- Y screen axis with an absolute angular value in
-- RADIANS.
raises BadValue from Viewer;
raises BadValue from V3d;
-- If the eye, view point, or high point are aligned or confused.
SetEye( me : mutable ; X,Y,Z : Coordinate )
---Level: Public
---Purpose: Defines the position of the eye..
raises BadValue from Viewer ;
raises BadValue from V3d ;
-- If the eye, view point, or high point are aligned or confused.
SetDepth( me : mutable ; Depth : Length )
---Level: Public
---Purpose: Defines the Depth of the eye from the view point
-- without update the projection .
raises BadValue from Viewer ;
raises BadValue from V3d ;
-- If the Depth is <= 0.
SetProj( me : mutable ; Vx,Vy,Vz : Parameter )
---Level: Public
---Purpose: Defines the orientation of the projection.
raises BadValue from Viewer ;
raises BadValue from V3d ;
-- If the eye, view point, or high point are aligned or confused.
SetProj( me : mutable ; Orientation : TypeOfOrientation )
---Level: Public
---Purpose: Defines the orientation of the projection .
raises BadValue from Viewer ;
raises BadValue from V3d ;
-- If the eye, view point, or high point are aligned or confused.
-- Updates the view
SetAt( me : mutable ; X,Y,Z : Coordinate )
---Level: Public
---Purpose: Defines the position of the view point.
raises BadValue from Viewer ;
raises BadValue from V3d ;
-- If the eye, view point, or high point are aligned or confused.
SetUp( me : mutable ; Vx,Vy,Vz : Parameter )
---Level: Public
---Purpose: Defines the orientation of the high point.
raises BadValue from Viewer ;
raises BadValue from V3d ;
-- If the eye, view point, or high point are aligned or confused.
SetUp( me : mutable ; Orientation : TypeOfOrientation )
---Level: Public
---Purpose: Defines the orientation(SO) of the high point.
raises BadValue from Viewer ;
raises BadValue from V3d ;
-- If the eye, view point, or high point are aligned or confused.
SetViewOrientation ( me : mutable; VO : ViewOrientation from Visual3d );
@ -849,20 +849,20 @@ is
---Level: Public
---Purpose: translates the center of the view and zooms the view.
-- Updates the view.
raises BadValue from Viewer ;
raises BadValue from V3d ;
SetCenter ( me : mutable ; Xc , Yc : Coordinate )
---Level: Public
---Purpose: Defines the centre of the view.
-- Updates the view.
raises BadValue from Viewer ;
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.
raises BadValue from Viewer ;
raises BadValue from V3d ;
-- If one of the dimensions of the projection is NULL.
SetSize ( me : mutable ; Size : Length )
@ -871,7 +871,7 @@ is
-- center and height/width ratio of the window supporting
-- the view.
-- NOTE than the Depth of the View is NOT modified .
raises BadValue from Viewer ;
raises BadValue from V3d ;
-- If the size of the view is <= 0
SetZSize ( me : mutable ; Size : Length )
@ -882,7 +882,7 @@ is
-- Any Object located Above the Front Plane or
-- behind the Back Plane will be Clipped .
-- NOTE than the XY Size of the View is NOT modified .
raises BadValue from Viewer ;
raises BadValue from V3d ;
-- If the size of the view is <= 0
SetZoom ( me : mutable ; Coef : Factor ; Start : Boolean = Standard_True )
@ -890,7 +890,7 @@ is
---Purpose: Zooms the view by a factor relative to the initial
-- value expressed by Start = Standard_True
-- Updates the view.
raises BadValue from Viewer ;
raises BadValue from V3d ;
-- If the zoom coefficient is <= 0
SetScale ( me : mutable ; Coef : Factor )
@ -898,7 +898,7 @@ is
---Purpose: Zooms the view by a factor relative to the value
-- initialised by SetViewMappingDefault().
-- Updates the view.
raises BadValue from Viewer ;
raises BadValue from V3d ;
-- If the zoom coefficient is <= 0
SetAxialScale ( me : mutable ; Sx, Sy, Sz : Real from Standard )
@ -911,7 +911,7 @@ is
-- || 0 0 Sz 0 ||
-- || 0 0 0 1 ||
-- Updates the view.
raises BadValue from Viewer ;
raises BadValue from V3d ;
-- If the one of factors <= 0
FitAll ( me : mutable ; Coef : Coefficient = 0.01;
@ -921,7 +921,7 @@ is
-- so as to occupy the maximum space while respecting the
-- margin coefficient and the initial height /width ratio.
-- NOTE than the original Z size of the view is NOT modified .
raises BadValue from Viewer ;
raises BadValue from V3d ;
-- If the margin coefficient is <0 ou >= 1 or
-- Updates the view
@ -931,7 +931,7 @@ is
-- 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 Viewer ;
raises BadValue from V3d ;
-- If the margin coefficient is <0 ou or
-- If No Objects are displayed in the view
@ -949,7 +949,7 @@ is
-- 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 Viewer;
raises BadValue from V3d;
-- If the defined projection window has zero size.
@ -959,9 +959,9 @@ is
-- 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 Viewer
raises BadValue from V3d
-- If the defined projection window has zero size.
is redefined static;
is static;
SetViewingVolume ( me : mutable ; Left, Right, Bottom, Top, ZNear, ZFar : Real from Standard)
---Level: Public
@ -970,7 +970,7 @@ is
-- 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 Viewer;
raises BadValue from V3d;
-- If the ZNear<0, ZFar<0 or ZNear>=Zfar.
SetViewMapping ( me : mutable; VM : ViewMapping from Visual3d );
@ -1265,7 +1265,7 @@ is
Window ( me ) returns mutable Window from Aspect
---Level: Public
---Purpose: Returns the Aspect Window associated with the view.
raises BadValue from Viewer;
raises BadValue from V3d;
-- If MyView is not associated with a window
Type( me ) returns TypeOfView from V3d;
@ -1387,6 +1387,9 @@ is
Matrix : Array2OfReal from TColStd )
returns Vector from Graphic3d is private ;
---Purpose: Transforms the vector V according to the matrice Matrix .
ImmediateUpdate (me) is static protected;
---Purpose:
-----------------------------------------
---Category: TransientManager methods
@ -1539,7 +1542,7 @@ is
Plot ( me : mutable )
---Purpose: Create a 2D View for plotting the contents of the view
raises BadValue from Viewer;
raises BadValue from V3d;
-- if the plotter is undefined.
Compute ( me; AVertex : Vertex from Graphic3d )
@ -1743,6 +1746,7 @@ fields
MyAnimationFlags : Integer from Standard;
MyTransparencyFlag : Boolean from Standard;
myImmediateUpdate: Boolean from Standard is protected;
friends
SetViewOn from class Viewer from V3d ( me : mutable ),

View File

@ -160,7 +160,7 @@ To solve the problem (for lack of a better solution) I make 2 passes.
#include <Image_AlienPixMap.hxx>
#include <V3d.hxx>
#include <V3d_View.ixx>
#include <Viewer_BadValue.hxx>
#include <V3d_BadValue.hxx>
#include <Standard_ShortReal.hxx>
#include <gp_Dir.hxx>
#include <TColStd_Array2OfReal.hxx>
@ -682,7 +682,7 @@ void V3d_View::SetAxis(const Standard_Real X, const Standard_Real Y, const Stand
Standard_Real D,Nx = Vx,Ny = Vy,Nz = Vz ;
D = Sqrt( Vx*Vx + Vy*Vy + Vz*Vz ) ;
Viewer_BadValue_Raise_if ( D <= 0. , "V3d_View::SetAxis, bad axis");
V3d_BadValue_Raise_if ( D <= 0. , "V3d_View::SetAxis, bad axis");
Nx /= D ; Ny /= D ; Nz /= D ;
MyDefaultViewPoint.SetCoord(X,Y,Z) ;
MyDefaultViewAxis.SetCoord(Nx,Ny,Nz) ;
@ -771,7 +771,7 @@ void V3d_View::Rotate(const Standard_Real ax, const Standard_Real ay, const Stan
MyViewReferenceUp = MyViewOrientation.ViewReferenceUp() ;
if (!ScreenAxis(MyViewReferencePlane,MyViewReferenceUp,
MyXscreenAxis,MyYscreenAxis,MyZscreenAxis))
Viewer_BadValue::Raise ("V3d_View::Rotate, alignment of Eye,At,Up");
V3d_BadValue::Raise ("V3d_View::Rotate, alignment of Eye,At,Up");
}
InitMatrix(Matrix) ;
@ -823,7 +823,7 @@ void V3d_View::Rotate(const Standard_Real ax, const Standard_Real ay, const Stan
MyViewReferenceUp = MyViewOrientation.ViewReferenceUp() ;
if (!ScreenAxis(MyViewReferencePlane,MyViewReferenceUp,
MyXscreenAxis,MyYscreenAxis,MyZscreenAxis))
Viewer_BadValue::Raise ("V3d_View::Rotate, alignment of Eye,At,Up");
V3d_BadValue::Raise ("V3d_View::Rotate, alignment of Eye,At,Up");
}
InitMatrix(Matrix) ;
@ -973,7 +973,7 @@ void V3d_View::Turn(const Standard_Real ax, const Standard_Real ay, const Standa
MyViewReferenceUp = MyViewOrientation.ViewReferenceUp() ;
if (!ScreenAxis(MyViewReferencePlane,MyViewReferenceUp,
MyXscreenAxis,MyYscreenAxis,MyZscreenAxis))
Viewer_BadValue::Raise ("V3d_View::Turn, alignment of Eye,At,Up");
V3d_BadValue::Raise ("V3d_View::Turn, alignment of Eye,At,Up");
}
InitMatrix(Matrix) ;
@ -1099,7 +1099,7 @@ void V3d_View::SetTwist(const Standard_Real angle)
MyXscreenAxis,MyYscreenAxis,MyZscreenAxis) ;
}
Viewer_BadValue_Raise_if( !TheStatus,"V3d_ViewSetTwist, alignment of Eye,At,Up,");
V3d_BadValue_Raise_if( !TheStatus,"V3d_ViewSetTwist, alignment of Eye,At,Up,");
MyViewReferencePoint = MyViewOrientation.ViewReferencePoint() ;
RotAxis(MyViewReferencePoint,MyZscreenAxis,Angle,Matrix) ;
@ -1132,7 +1132,7 @@ void V3d_View::SetEye(const Standard_Real X,const Standard_Real Y,const Standard
MyViewReferenceUp = MyViewOrientation.ViewReferenceUp() ;
Xpn = X - Xat ; Ypn = Y - Yat ; Zpn = Z - Zat ;
Zrp = Sqrt(Xpn*Xpn + Ypn*Ypn + Zpn*Zpn) ;
Viewer_BadValue_Raise_if( Zrp <= 0. , "V3d_View::SetEye:: Eye,At are Confused");
V3d_BadValue_Raise_if( Zrp <= 0. , "V3d_View::SetEye:: Eye,At are Confused");
Xpn /= Zrp ; Ypn /= Zrp ; Zpn /= Zrp ;
MyViewReferencePlane.SetCoord(Xpn,Ypn,Zpn) ;
@ -1171,9 +1171,9 @@ void V3d_View::SetDepth(const Standard_Real Depth)
{
Standard_Real Xrp,Yrp,Zrp ;
#ifdef IMP250200
Viewer_BadValue_Raise_if( Depth == 0. ,"V3d_View::SetDepth, bad depth");
V3d_BadValue_Raise_if( Depth == 0. ,"V3d_View::SetDepth, bad depth");
#else
Viewer_BadValue_Raise_if( Depth <= 0. ,"V3d_View::SetDepth, bad depth");
V3d_BadValue_Raise_if( Depth <= 0. ,"V3d_View::SetDepth, bad depth");
#endif
MyViewReferencePoint = MyViewOrientation.ViewReferencePoint() ;
@ -1231,7 +1231,7 @@ void V3d_View::SetProj( const Standard_Real Vx,const Standard_Real Vy, const Sta
{
Standard_Real Angle ;
Viewer_BadValue_Raise_if( Sqrt(Vx*Vx + Vy*Vy + Vz*Vz) <= 0.,
V3d_BadValue_Raise_if( Sqrt(Vx*Vx + Vy*Vy + Vz*Vz) <= 0.,
"V3d_View::SetProj, null projection vector");
Angle = Twist() ;
@ -1290,7 +1290,7 @@ void V3d_View::SetAt(const Standard_Real X,const Standard_Real Y,const Standard_
Xeye = Zrp*Xpn + Xat ; Yeye = Zrp*Ypn + Yat ; Zeye = Zrp*Zpn + Zat ;
Xpn = Xeye - X ; Ypn = Yeye - Y ; Zpn = Zeye - Z ;
Zrp = Sqrt(Xpn*Xpn + Ypn*Ypn + Zpn*Zpn) ;
Viewer_BadValue_Raise_if( Zrp <= 0.,
V3d_BadValue_Raise_if( Zrp <= 0.,
"V3d_View::SetAt, Eye,At are Confused");
Xpn /= Zrp ; Ypn /= Zrp ; Zpn /= Zrp ;
@ -1332,7 +1332,7 @@ void V3d_View::SetAt(const Standard_Real X,const Standard_Real Y,const Standard_
void V3d_View::SetUp(const Standard_Real Vx,const Standard_Real Vy,const Standard_Real Vz)
{
Standard_Boolean TheStatus ;
Viewer_BadValue_Raise_if( Sqrt(Vx*Vx + Vy*Vy + Vz*Vz) <= 0. ,
V3d_BadValue_Raise_if( Sqrt(Vx*Vx + Vy*Vy + Vz*Vz) <= 0. ,
"V3d_View::SetUp, nullUp vector");
MyViewReferencePlane = MyViewOrientation.ViewReferencePlane() ;
@ -1355,7 +1355,7 @@ void V3d_View::SetUp(const Standard_Real Vx,const Standard_Real Vy,const Standar
TheStatus = ScreenAxis(MyViewReferencePlane,MyViewReferenceUp,
MyXscreenAxis,MyYscreenAxis,MyZscreenAxis) ;
}
Viewer_BadValue_Raise_if( !TheStatus,"V3d_View::Setup, alignment of Eye,At,Up");
V3d_BadValue_Raise_if( !TheStatus,"V3d_View::Setup, alignment of Eye,At,Up");
MyViewReferenceUp = MyYscreenAxis ;
MyViewOrientation.SetViewReferenceUp(MyViewReferenceUp) ;
@ -1386,7 +1386,7 @@ void V3d_View::SetUp( const V3d_TypeOfOrientation Orientation )
TheStatus = ScreenAxis(MyViewReferencePlane,MyViewReferenceUp,
MyXscreenAxis,MyYscreenAxis,MyZscreenAxis) ;
}
Viewer_BadValue_Raise_if( !TheStatus, "V3d_View::SetUp, alignment of Eye,At,Up");
V3d_BadValue_Raise_if( !TheStatus, "V3d_View::SetUp, alignment of Eye,At,Up");
MyViewReferenceUp = MyYscreenAxis ;
MyViewOrientation.SetViewReferenceUp(MyViewReferenceUp) ;
@ -1434,7 +1434,7 @@ void V3d_View::Reset( const Standard_Boolean update )
void V3d_View::Panning(const Standard_Real Dx, const Standard_Real Dy, const Quantity_Factor aZoomFactor, const Standard_Boolean Start)
{
Standard_Real Umin,Vmin,Umax,Vmax,Xrp,Yrp,Zrp,Dxv,Dyv ;
Viewer_BadValue_Raise_if( aZoomFactor <= 0.,"V3d_View::Panning, bad zoom factor");
V3d_BadValue_Raise_if( aZoomFactor <= 0.,"V3d_View::Panning, bad zoom factor");
if( Start ) {
MyProjReferencePoint = MyViewMapping.ProjectionReferencePoint() ;
@ -1443,7 +1443,7 @@ void V3d_View::Panning(const Standard_Real Dx, const Standard_Real Dy, const Qua
MyYwindowCenter = (Vmin + Vmax)/2. ;
MyWindowWidth = Abs(Umax - Umin) ;
MyWindowHeight = Abs(Vmax - Vmin) ;
Viewer_BadValue_Raise_if( MyWindowWidth <= 0. || MyWindowHeight <= 0. ,
V3d_BadValue_Raise_if( MyWindowWidth <= 0. || MyWindowHeight <= 0. ,
"V3d_View::Panning, Window Size is NULL");
}
MyProjReferencePoint.Coord(Xrp,Yrp,Zrp) ;
@ -1477,7 +1477,7 @@ void V3d_View::SetCenter(const Standard_Real Xc, const Standard_Real Yc)
MyXwindowCenter = Xrp = Xc ; MyYwindowCenter = Yrp = Yc ;
MyViewMapping.WindowLimit(Umin,Vmin,Umax,Vmax) ;
MyWindowWidth = Abs(Umax - Umin) ; MyWindowHeight = Abs(Vmax - Vmin) ;
Viewer_BadValue_Raise_if( MyWindowWidth <= 0. || MyWindowHeight <= 0. ,
V3d_BadValue_Raise_if( MyWindowWidth <= 0. || MyWindowHeight <= 0. ,
"V3d_View::SetCenter, Window Size is NULL");
Umin = Xc - MyWindowWidth/2. ; Vmin = Yc - MyWindowHeight/2. ;
@ -1495,7 +1495,7 @@ void V3d_View::SetSize(const Standard_Real Size)
{
Standard_Real Umin,Vmin,Umax,Vmax,Rap ;
Viewer_BadValue_Raise_if( Size <= 0.,
V3d_BadValue_Raise_if( Size <= 0.,
"V3d_View::SetSize, Window Size is NULL");
@ -1534,7 +1534,7 @@ void V3d_View::SetZSize(const Standard_Real Size)
if( Zmax <= MyViewMapping.FrontPlaneDistance() ) return;
}
#else
Viewer_BadValue_Raise_if( Size <= 0.,
V3d_BadValue_Raise_if( Size <= 0.,
"V3d_View::SetZSize, Window ZSize is NULL");
#endif
@ -1563,7 +1563,7 @@ void V3d_View::SetZSize(const Standard_Real Size)
void V3d_View::SetZoom(const Standard_Real Coef,const Standard_Boolean Start)
{
Standard_Real Umin,Vmin,Umax,Vmax,Dxv,Dyv ;
Viewer_BadValue_Raise_if( Coef <= 0.,"V3d_View::SetZoom, bad coefficient");
V3d_BadValue_Raise_if( Coef <= 0.,"V3d_View::SetZoom, bad coefficient");
if( Start ) {
MyViewMapping.WindowLimit(Umin,Vmin,Umax,Vmax) ;
@ -1598,7 +1598,7 @@ void V3d_View::SetScale( const Standard_Real Coef )
Standard_Real Umin,Vmin,Umax,Vmax,Xrp,Yrp,Dxv,Dyv ;
Visual3d_ViewMapping VMD = MyView->ViewMappingDefault() ;
Viewer_BadValue_Raise_if( Coef <= 0. ,"V3d_View::SetScale, bad coefficient");
V3d_BadValue_Raise_if( Coef <= 0. ,"V3d_View::SetScale, bad coefficient");
VMD.WindowLimit(Umin,Vmin,Umax,Vmax) ;
Dxv = Abs(Umax - Umin) ; Dyv = Abs(Vmax - Vmin) ;
@ -1616,7 +1616,7 @@ void V3d_View::SetAxialScale( const Standard_Real Sx, const Standard_Real Sy, co
{
Standard_Real Xmin,Ymin,Zmin,Xmax,Ymax,Zmax,U,V,W ;
Standard_Real Umin,Vmin,Wmin,Umax,Vmax,Wmax ;
Viewer_BadValue_Raise_if( Sx <= 0. || Sy <= 0. || Sz <= 0.,"V3d_View::SetAxialScale, bad coefficient");
V3d_BadValue_Raise_if( Sx <= 0. || Sy <= 0. || Sz <= 0.,"V3d_View::SetAxialScale, bad coefficient");
MyViewOrientation.SetAxialScale( Sx, Sy, Sz );
Aspect_TypeOfUpdate updateMode = MyView->ViewManager()->UpdateMode();
@ -2586,7 +2586,7 @@ void V3d_View::SetViewingVolume(const Standard_Real Left, const Standard_Real Ri
{
Standard_Real Umin,Vmin,Umax,Vmax,Xrp,Yrp,Zrp;
Viewer_BadValue_Raise_if ( ZNear <= 0. || ZFar <= 0. || ZNear >= ZFar, "V3d_View::SetVolume, bad distances");
V3d_BadValue_Raise_if ( ZNear <= 0. || ZFar <= 0. || ZNear >= ZFar, "V3d_View::SetVolume, bad distances");
MyProjReferencePoint = MyViewMapping.ProjectionReferencePoint() ;
MyProjReferencePoint.Coord(Xrp,Yrp,Zrp) ;
@ -2900,7 +2900,7 @@ void V3d_View::ZoomAtPoint(const Standard_Integer mouseStartX,
Standard_Real dzoom = fabs(d) / 100.0 + 1.0;
dzoom = (d > 0) ? dzoom : 1.0 / dzoom;
Viewer_BadValue_Raise_if( dzoom <= 0.,"V3d_View::ZoomAtPoint, bad coefficient");
V3d_BadValue_Raise_if( dzoom <= 0.,"V3d_View::ZoomAtPoint, bad coefficient");
Standard_Real Umin,Vmin,Umax,Vmax;
MyViewMapping.WindowLimit(Umin,Vmin,Umax,Vmax);
@ -2988,7 +2988,7 @@ void V3d_View::FitAll(const Handle(Aspect_Window)& aWindow,
Standard_Integer Xpixel,Ypixel;
//Standard_Integer Xleft,Yup,Xright,Ylow ;
Viewer_BadValue_Raise_if( (Xmin == Xmax) || (Ymin == Ymax) ,
V3d_BadValue_Raise_if( (Xmin == Xmax) || (Ymin == Ymax) ,
"V3d_View::FitAll, Window Size is NULL");
MyProjReferencePoint = MyViewMapping.ProjectionReferencePoint() ;
@ -3256,7 +3256,7 @@ void V3d_View::SetPlotter(const Handle(Graphic3d_Plotter)& aPlotter)
void V3d_View::Plot()
{
Viewer_BadValue_Raise_if( !MyPlotter.IsNull(), "view has no plotter");
V3d_BadValue_Raise_if( !MyPlotter.IsNull(), "view has no plotter");
MyView->Plot(MyPlotter);
}
@ -3456,3 +3456,15 @@ Standard_Boolean V3d_View::ToPixMap (Image_PixMap& theImage,
cView->ptrFBO = aPrevFBOPtr;
return isSuccess;
}
void V3d_View::ImmediateUpdate() const
{
if (myImmediateUpdate) Update();
}
Standard_Boolean V3d_View::SetImmediateUpdate (const Standard_Boolean theImmediateUpdate)
{
Standard_Boolean aPreviousMode = myImmediateUpdate;
myImmediateUpdate = theImmediateUpdate;
return aPreviousMode;
}

View File

@ -60,7 +60,7 @@ void V3d_View::SetZClippingDepth(const Standard_Real Depth) {
void V3d_View::SetZClippingWidth(const Standard_Real Width) {
Standard_Real Front,Back,Depth ;
Viewer_BadValue_Raise_if( Width <= 0.,"V3d_View::SetZClippingWidth, bad width");
V3d_BadValue_Raise_if( Width <= 0.,"V3d_View::SetZClippingWidth, bad width");
Front = MyViewContext.ZClippingFrontPlane() ;
Back = MyViewContext.ZClippingBackPlane() ;
@ -136,7 +136,7 @@ void V3d_View::SetZCueingDepth(const Standard_Real Depth) {
void V3d_View::SetZCueingWidth(const Standard_Real Width) {
Standard_Real Front,Back,Depth ;
Viewer_BadValue_Raise_if( Width <= 0.,"V3d_View::SetZCueingWidth, bad width");
V3d_BadValue_Raise_if( Width <= 0.,"V3d_View::SetZCueingWidth, bad width");
Front = MyViewContext.DepthCueingFrontPlane() ;
Back = MyViewContext.DepthCueingBackPlane() ;

View File

@ -54,10 +54,10 @@ void V3d_View::SetLightOn( const Handle(V3d_Light)& TheLight ) {
if( !MyActiveLights.Contains(TheLight)){
#ifdef GER61454
Viewer_BadValue_Raise_if( MyActiveLights.Extent() >= MyView->LightLimit(),
V3d_BadValue_Raise_if( MyActiveLights.Extent() >= MyView->LightLimit(),
"too many lights");
#else
// Viewer_BadValue_Raise_if( MyActiveLights.Extent() >= Visual3d_Light::Limit(),
// V3d_BadValue_Raise_if( MyActiveLights.Extent() >= Visual3d_Light::Limit(),
// "too many lights");
#endif
MyActiveLights.Append(TheLight) ;
@ -123,14 +123,14 @@ void V3d_View::SetPlaneOn( const Handle(V3d_Plane)& ThePlane ) {
#ifdef GER61454
if( !MyActivePlanes.Contains(ThePlane)) {
Viewer_BadValue_Raise_if( MyActivePlanes.Extent() >= MyView->PlaneLimit(), "too many planes");
V3d_BadValue_Raise_if( MyActivePlanes.Extent() >= MyView->PlaneLimit(), "too many planes");
MyActivePlanes.Append(ThePlane) ;
}
MyViewContext.SetClipPlaneOn(ThePlane->Plane()) ;
MyView->SetContext(MyViewContext);
#else //GER61454
if( !MyActivePlanes.Contains(ThePlane)) {
Viewer_BadValue_Raise_if( MyActivePlanes.Extent() >= Visual3d_ClipPlane::Limit(), "too many planes");
V3d_BadValue_Raise_if( MyActivePlanes.Extent() >= Visual3d_ClipPlane::Limit(), "too many planes");
MyActivePlanes.Append(ThePlane) ;
MyViewContext.SetClipPlaneOn(ThePlane->Plane()) ;
@ -156,7 +156,7 @@ void V3d_View::SetPlaneOn( ) {
#ifdef GER61454
for(MyViewer->InitDefinedPlanes();MyViewer->MoreDefinedPlanes();MyViewer->NextDefinedPlanes()) {
if(!MyActivePlanes.Contains(MyViewer->DefinedPlane())) {
Viewer_BadValue_Raise_if( MyActivePlanes.Extent() >= MyView->PlaneLimit(), "too many planes");
V3d_BadValue_Raise_if( MyActivePlanes.Extent() >= MyView->PlaneLimit(), "too many planes");
MyActivePlanes.Append(MyViewer->DefinedPlane());
}
MyViewContext.SetClipPlaneOn(MyViewer->DefinedPlane()->Plane());
@ -165,7 +165,7 @@ void V3d_View::SetPlaneOn( ) {
#else //GER61454
for(MyViewer->InitDefinedPlanes();MyViewer->MoreDefinedPlanes();MyViewer->NextDefinedPlanes()) {
if(!MyActivePlanes.Contains(MyViewer->DefinedPlane())) {
Viewer_BadValue_Raise_if( MyActivePlanes.Extent() >= Visual3d_ClipPlane::Limit(),
V3d_BadValue_Raise_if( MyActivePlanes.Extent() >= Visual3d_ClipPlane::Limit(),
"too many planes");
MyActivePlanes.Append(MyViewer->DefinedPlane());
MyViewContext.SetClipPlaneOn(MyViewer->DefinedPlane()->Plane());

View File

@ -60,7 +60,7 @@ void V3d_View::Move(const Standard_Real Dx, const Standard_Real Dy, const Standa
MyViewReferenceUp = MyViewOrientation.ViewReferenceUp() ;
if (!ScreenAxis(MyViewReferencePlane,MyViewReferenceUp,
MyXscreenAxis,MyYscreenAxis,MyZscreenAxis))
Viewer_BadValue::Raise ("V3d_View::Move, alignment of Eye,At,Up");
V3d_BadValue::Raise ("V3d_View::Move, alignment of Eye,At,Up");
}
MyXscreenAxis.Coord(XX,XY,XZ) ;
MyYscreenAxis.Coord(YX,YY,YZ) ;
@ -71,7 +71,7 @@ void V3d_View::Move(const Standard_Real Dx, const Standard_Real Dy, const Standa
Yeye = Zrp*Ypn + Dx*XY + Dy*YY + Dz*ZY ;
Zeye = Zrp*Zpn + Dx*XZ + Dy*YZ + Dz*ZZ ;
Zrp = sqrt( Xeye*Xeye + Yeye*Yeye + Zeye*Zeye ) ;
Viewer_BadValue_Raise_if( Zrp <= 0. ,"V3d_View::Move:: Eye,At are Confused");
V3d_BadValue_Raise_if( Zrp <= 0. ,"V3d_View::Move:: Eye,At are Confused");
#ifdef DEB
Standard_Real focale =
#endif
@ -122,7 +122,7 @@ void V3d_View::Move(const Standard_Real Length, const Standard_Boolean Start) {
Yeye = Zrp*Ypn + Vy*Length ;
Zeye = Zrp*Zpn + Vz*Length ;
Zrp = sqrt( Xeye*Xeye + Yeye*Yeye + Zeye*Zeye ) ;
Viewer_BadValue_Raise_if( Zrp <= 0. ,"V3d_View::Move:: Eye,At are Confused");
V3d_BadValue_Raise_if( Zrp <= 0. ,"V3d_View::Move:: Eye,At are Confused");
#ifdef DEB
Standard_Real focale =
@ -185,7 +185,7 @@ void V3d_View::Translate(const Standard_Real Dx, const Standard_Real Dy, const S
MyProjReferencePoint = MyViewMapping.ProjectionReferencePoint();
if (!ScreenAxis(MyViewReferencePlane,MyViewReferenceUp,
MyXscreenAxis,MyYscreenAxis,MyZscreenAxis))
Viewer_BadValue::Raise ("V3d_View::Translate, alignment of Eye,At,Up");
V3d_BadValue::Raise ("V3d_View::Translate, alignment of Eye,At,Up");
}
MyXscreenAxis.Coord(XX,XY,XZ) ;
MyYscreenAxis.Coord(YX,YY,YZ) ;

View File

@ -28,7 +28,7 @@
-- Add ShowGridEcho() private method
-- SAV - 26/11/02 -> Add new field to store grid echo aspect
class Viewer from V3d
class Viewer from V3d inherits TShared from MMgt
---Version:
@ -41,10 +41,6 @@ class Viewer from V3d
---References:
inherits
Viewer from Viewer
uses
GraphicDriver from Graphic3d,
@ -86,29 +82,29 @@ uses
raises
BadValue from Viewer
BadValue from V3d
is
Create ( theDriver : GraphicDriver from Graphic3d;
aName : ExtString from Standard;
aDomain : CString from Standard = "";
ViewSize : Length from Quantity = 1000.0 ;
ViewProj : TypeOfOrientation from V3d= V3d_XposYnegZpos ;
ViewBackground : NameOfColor from Quantity = Quantity_NOC_GRAY30;
Visualization : TypeOfVisualization from V3d = V3d_ZBUFFER;
ShadingModel : TypeOfShadingModel from V3d = V3d_GOURAUD ;
UpdateMode : TypeOfUpdate from V3d = V3d_WAIT;
ComputedMode : Boolean from Standard = Standard_True;
DefaultComputedMode: Boolean from Standard = Standard_True;
SurfaceDetail : TypeOfSurfaceDetail from V3d = V3d_TEX_NONE)
Create (theDriver : GraphicDriver from Graphic3d;
theName : ExtString from Standard;
theDomain : CString from Standard = "";
theViewSize : Length from Quantity = 1000.0 ;
theViewProj : TypeOfOrientation from V3d= V3d_XposYnegZpos ;
theViewBackground : NameOfColor from Quantity = Quantity_NOC_GRAY30;
theVisualization : TypeOfVisualization from V3d = V3d_ZBUFFER;
theShadingModel : TypeOfShadingModel from V3d = V3d_GOURAUD ;
theUpdateMode : TypeOfUpdate from V3d = V3d_WAIT;
theComputedMode : Boolean from Standard = Standard_True;
theDefaultComputedMode: Boolean from Standard = Standard_True;
theSurfaceDetail : TypeOfSurfaceDetail from V3d = V3d_TEX_NONE)
returns mutable Viewer from V3d
---Purpose: Create a Viewer with the given graphic driver and the given parameters or
-- with their default values.
-- Currently creating of more than 100 viewer instances
-- is not supported and leads to an exception.
-- This limitation might be addressed in some future OCCT releases.
raises BadValue from Viewer ;
raises BadValue from V3d ;
---Purpose: If the size of the view is <= 0
-- if ComputedMode is false, only the degenerate mode will be used.
--
@ -137,7 +133,7 @@ is
---Purpose: Activates a particular view in the Viewer .
-- Must be call if the Window attached to the view
-- has been Deiconified .
raises BadValue from Viewer;
raises BadValue from V3d;
-- If the view is not mapped on the window.
SetViewOff (me:mutable);
@ -150,10 +146,10 @@ is
---Purpose: Deactivates a particular view in the Viewer.
-- Must be call if the Window attached to the view
-- has been Iconified .
raises BadValue from Viewer;
raises BadValue from V3d;
-- If the view is not mapped on the window.
Update (me:mutable ) is redefined static;
Update (me:mutable ) is static;
---Level: Public
---Purpose: Deprecated, Redraw() should be used instead.
@ -218,7 +214,7 @@ is
---Level: Public
---Purpose: Gives a default size for the creation of views of
-- the viewer.
raises BadValue from Viewer;
raises BadValue from V3d;
-- If the size of the view is <= 0
SetDefaultViewProj (me:mutable; Orientation : TypeOfOrientation );
@ -281,13 +277,13 @@ is
SetLightOn(me:mutable; MyLight : Light from V3d )
---Level: Public
---Purpose: Activates MyLight in the viewer.
raises BadValue from Viewer;
raises BadValue from V3d;
-- If No More Light can be activated in MyViewer .
SetLightOn(me:mutable)
---Level: Public
---Purpose: Activates all the lights defined in this viewer.
raises BadValue from Viewer;
raises BadValue from V3d;
-- If No More Light can be activated in MyViewer .
SetLightOff(me:mutable; MyLight : Light from V3d );
@ -696,8 +692,25 @@ is
-- from lowest layer to highest ( foreground ). The first layer ID
-- in sequence is the default layer that can't be removed.
Driver(me) returns mutable GraphicDriver from Graphic3d
is static;
---C++: return const &
NextName(me) returns ExtString from Standard
is static;
Domain(me) returns CString from Standard
is static;
IncrCount(me:mutable) is static protected;
fields
myNextCount: Integer from Standard;
myDriver: GraphicDriver from Graphic3d;
myName: ExtendedString from TCollection;
myDomain: AsciiString from TCollection;
MyViewer: ViewManager from Visual3d ;
MyDefinedViews: ListOfTransient from V3d;
MyActiveViews: ListOfTransient from V3d;

View File

@ -46,15 +46,29 @@
#include <Visual3d_Light.hxx>
#include <V3d_Viewer.ixx>
#include <V3d_View.hxx>
#include <Viewer_BadValue.hxx>
#include <V3d_BadValue.hxx>
#include <V3d_OrthographicView.hxx>
#include <V3d_PerspectiveView.hxx>
/*----------------------------------------------------------------------*/
//-Constructor:
V3d_Viewer::V3d_Viewer(const Handle(Graphic3d_GraphicDriver)& theDriver , const Standard_ExtString aName, const Standard_CString aDomain,const Standard_Real ViewSize , const V3d_TypeOfOrientation ViewProj , const Quantity_NameOfColor ViewBackground , const V3d_TypeOfVisualization Visualization , const V3d_TypeOfShadingModel ShadingModel , const V3d_TypeOfUpdate UpdateMode, const Standard_Boolean ComputedMode , const Standard_Boolean DefaultComputedMode , const V3d_TypeOfSurfaceDetail SurfaceDetail )
:Viewer_Viewer(theDriver,aName,aDomain,-1),
V3d_Viewer::V3d_Viewer (const Handle(Graphic3d_GraphicDriver)& theDriver,
const Standard_ExtString theName,
const Standard_CString theDomain,
const Standard_Real theViewSize,
const V3d_TypeOfOrientation theViewProj,
const Quantity_NameOfColor theViewBackground,
const V3d_TypeOfVisualization theVisualization,
const V3d_TypeOfShadingModel theShadingModel,
const V3d_TypeOfUpdate theUpdateMode,
const Standard_Boolean theComputedMode,
const Standard_Boolean theDefaultComputedMode,
const V3d_TypeOfSurfaceDetail theSurfaceDetail)
:myNextCount (-1),
myDriver (theDriver),
myName (TCollection_ExtendedString (theName)),
myDomain (TCollection_AsciiString (theDomain)),
MyDefinedViews(),
MyActiveViews(),
MyDefinedLights(),
@ -65,36 +79,35 @@ myDefinedViewsIterator(),
myActiveLightsIterator(),
myDefinedLightsIterator(),
myDefinedPlanesIterator(),
myComputedMode(ComputedMode),
myDefaultComputedMode(DefaultComputedMode),
myPrivilegedPlane(gp_Ax3(gp_Pnt(0.,0.,0),gp_Dir(0.,0.,1.),gp_Dir(1.,0.,0.))),
myDisplayPlane(Standard_False),
myDisplayPlaneLength(ViewSize)
myComputedMode (theComputedMode),
myDefaultComputedMode (theDefaultComputedMode),
myPrivilegedPlane (gp_Ax3 (gp_Pnt (0.,0.,0), gp_Dir (0.,0.,1.), gp_Dir (1.,0.,0.))),
myDisplayPlane (Standard_False),
myDisplayPlaneLength (theViewSize)
#ifdef IMP240100
,myGridEcho(Standard_True),myGridEchoStructure(),myGridEchoGroup()
,myGridEcho (Standard_True), myGridEchoStructure(), myGridEchoGroup()
#endif
{
MyViewer = new Visual3d_ViewManager(theDriver) ;
MyViewer = new Visual3d_ViewManager (theDriver);
// san (16/09/2010): It has been decided to turn depth test ON
// by default, as this is important for new font rendering
// (without it, there are numerous texture rendering artefacts)
MyViewer->SetZBufferAuto (Standard_False);
SetUpdateMode( UpdateMode ) ;
SetDefaultViewSize(ViewSize) ;
SetDefaultViewProj(ViewProj) ;
SetDefaultBackgroundColor(ViewBackground) ;
SetDefaultVisualization(Visualization) ;
SetDefaultShadingModel(ShadingModel) ;
SetDefaultSurfaceDetail(SurfaceDetail) ;
SetDefaultAngle(M_PI / 2.);
SetDefaultTypeOfView(V3d_ORTHOGRAPHIC);
SetUpdateMode (theUpdateMode);
SetDefaultViewSize (theViewSize);
SetDefaultViewProj (theViewProj);
SetDefaultBackgroundColor (theViewBackground);
SetDefaultVisualization (theVisualization);
SetDefaultShadingModel (theShadingModel);
SetDefaultSurfaceDetail (theSurfaceDetail);
SetDefaultAngle (M_PI / 2.);
SetDefaultTypeOfView (V3d_ORTHOGRAPHIC);
Quantity_Color Color1 (Quantity_NOC_GRAY50);
Quantity_Color Color2 (Quantity_NOC_GRAY70);
// Quantity_Color White (Quantity_NOC_WHITE);
myRGrid = new V3d_RectangularGrid(this,Color1,Color2);
myCGrid = new V3d_CircularGrid(this,Color1,Color2);
myRGrid = new V3d_RectangularGrid (this, Color1, Color2);
myCGrid = new V3d_CircularGrid (this, Color1, Color2);
myGridType = Aspect_GT_Rectangular;
}
@ -233,7 +246,7 @@ void V3d_Viewer::SetDefaultBgGradientColors( const Quantity_Color& Color1,
void V3d_Viewer::SetDefaultViewSize(const Standard_Real Size) {
Viewer_BadValue_Raise_if( Size <= 0. ,"V3d_Viewer::SetDefaultViewSize, bad size");
V3d_BadValue_Raise_if( Size <= 0. ,"V3d_Viewer::SetDefaultViewSize, bad size");
MyViewSize = Size ;
}
@ -395,3 +408,46 @@ void V3d_Viewer::GetAllZLayers (TColStd_SequenceOfInteger& theLayerSeq) const
{
MyViewer->GetAllZLayers (theLayerSeq);
}
//=======================================================================
//function : Domain
//purpose :
//=======================================================================
Standard_CString V3d_Viewer::Domain() const
{
return myDomain.ToCString();
}
//=======================================================================
//function : Driver
//purpose :
//=======================================================================
const Handle(Graphic3d_GraphicDriver)& V3d_Viewer::Driver() const
{
return myDriver;
}
//=======================================================================
//function : NextName
//purpose :
//=======================================================================
Standard_ExtString V3d_Viewer::NextName() const
{
TCollection_ExtendedString aNextName = TCollection_ExtendedString (myName.ToExtString());
aNextName.AssignCat (TCollection_ExtendedString (myNextCount));
return aNextName.ToExtString();
}
//=======================================================================
//function : IncrCount
//purpose :
//=======================================================================
void V3d_Viewer::IncrCount()
{
myNextCount++;
}

View File

@ -20,7 +20,7 @@
#include <V3d_DirectionalLight.hxx>
#include <V3d_PositionalLight.hxx>
#include <V3d_AmbientLight.hxx>
#include <Viewer_BadValue.hxx>
#include <V3d_BadValue.hxx>
#include <V3d.hxx>
void V3d_Viewer::UpdateLights() {
@ -33,7 +33,7 @@ void V3d_Viewer::SetLightOn( const Handle(V3d_Light)& TheLight ) {
if(!MyActiveLights.Contains(TheLight)) {
// Viewer_BadValue_Raise_if( MyActiveLights.Extent() >= Visual3d_Light::Limit(),
// V3d_BadValue_Raise_if( MyActiveLights.Extent() >= Visual3d_Light::Limit(),
// "too many lights");
MyActiveLights.Append(TheLight) ;
}
@ -54,7 +54,7 @@ void V3d_Viewer::SetLightOn() {
for (InitDefinedLights();MoreDefinedLights();NextDefinedLights()) {
if(!MyActiveLights.Contains(DefinedLight())) {
// Viewer_BadValue_Raise_if( MyActiveLights.Extent() >= Visual3d_Light::Limit(),
// V3d_BadValue_Raise_if( MyActiveLights.Extent() >= Visual3d_Light::Limit(),
// "too many lights");
MyActiveLights.Append(DefinedLight());
for (InitActiveViews();MoreActiveViews();NextActiveViews()) {

View File

@ -1,33 +0,0 @@
-- Created on: 1995-04-06
-- Created by: Jean-Louis Frenkel
-- Copyright (c) 1995-1999 Matra Datavision
-- Copyright (c) 1999-2012 OPEN CASCADE SAS
--
-- The content of this file is subject to the Open CASCADE Technology Public
-- License Version 6.5 (the "License"). You may not use the content of this file
-- except in compliance with the License. Please obtain a copy of the License
-- at http://www.opencascade.org and read it completely before using this file.
--
-- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
-- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
--
-- The Original Code and all software distributed under the License is
-- distributed on an "AS IS" basis, without warranty of any kind, and the
-- Initial Developer hereby disclaims all such warranties, including without
-- limitation, any warranties of merchantability, fitness for a particular
-- purpose or non-infringement. Please see the License for the specific terms
-- and conditions governing the rights and limitations under the License.
package Viewer
uses MMgt,TCollection,Graphic3d,Quantity
is
deferred class Viewer;
deferred class View;
exception BadValue inherits OutOfRange;
end Viewer;

View File

@ -1,66 +0,0 @@
-- Created on: 1996-03-07
-- Created by: Jean-Louis Frenkel
-- Copyright (c) 1996-1999 Matra Datavision
-- Copyright (c) 1999-2012 OPEN CASCADE SAS
--
-- The content of this file is subject to the Open CASCADE Technology Public
-- License Version 6.5 (the "License"). You may not use the content of this file
-- except in compliance with the License. Please obtain a copy of the License
-- at http://www.opencascade.org and read it completely before using this file.
--
-- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
-- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
--
-- The Original Code and all software distributed under the License is
-- distributed on an "AS IS" basis, without warranty of any kind, and the
-- Initial Developer hereby disclaims all such warranties, including without
-- limitation, any warranties of merchantability, fitness for a particular
-- purpose or non-infringement. Please see the License for the specific terms
-- and conditions governing the rights and limitations under the License.
deferred class View from Viewer inherits TShared from MMgt
---Purpose: This class defines a view.
uses
Length from Quantity,Factor from Quantity
raises
BadValue from Viewer
is
Initialize;
Update(me)
---Purpose: Clears the window and redraws all primitives.
is deferred;
SetImmediateUpdate(me: mutable; onoff: Boolean from Standard)
---Purpose: sets the immediate update mode and returns the previous one.
returns Boolean from Standard;
ImmediateUpdate(me)
---Purpose:
is static protected;
WindowFit(me: mutable ; Xmin, Ymin, Xmax, Ymax : Integer)
---Purpose: Centres the defined pixel window defined by the
-- minimum and maximum pixels Xmin, Ymin, Xmax,
-- Ymax so that it occupies the largest possible space
-- while maintaining the initial height/width ratio.
-- Exceptions
-- Viewer_BadValue if the size of the defined
-- projection window is equal to 0.
raises BadValue from Viewer
is deferred;
Place (me:mutable; x,y: Integer from Standard;
aZoomFactor: Factor from Quantity = 1)
---Purpose: Sets the center of the object space defined by x, y
-- and the zoom factor aZoomFactor. The view is updated.
is deferred;
fields
myImmediateUpdate: Boolean from Standard is protected;
end View from Viewer;

View File

@ -1,30 +0,0 @@
// Copyright (c) 1999-2012 OPEN CASCADE SAS
//
// The content of this file is subject to the Open CASCADE Technology Public
// License Version 6.5 (the "License"). You may not use the content of this file
// except in compliance with the License. Please obtain a copy of the License
// at http://www.opencascade.org and read it completely before using this file.
//
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
//
// The Original Code and all software distributed under the License is
// distributed on an "AS IS" basis, without warranty of any kind, and the
// Initial Developer hereby disclaims all such warranties, including without
// limitation, any warranties of merchantability, fitness for a particular
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
#include <Viewer_View.ixx>
Viewer_View::Viewer_View():myImmediateUpdate (Standard_True) {}
void Viewer_View::ImmediateUpdate() const {
if (myImmediateUpdate) Update();
}
Standard_Boolean Viewer_View::SetImmediateUpdate(const Standard_Boolean onoff) {
Standard_Boolean p = myImmediateUpdate;
myImmediateUpdate = onoff;
return p;
}

View File

@ -1,54 +0,0 @@
-- Created on: 1995-04-06
-- Created by: Jean-Louis Frenkel
-- Copyright (c) 1995-1999 Matra Datavision
-- Copyright (c) 1999-2012 OPEN CASCADE SAS
--
-- The content of this file is subject to the Open CASCADE Technology Public
-- License Version 6.5 (the "License"). You may not use the content of this file
-- except in compliance with the License. Please obtain a copy of the License
-- at http://www.opencascade.org and read it completely before using this file.
--
-- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
-- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
--
-- The Original Code and all software distributed under the License is
-- distributed on an "AS IS" basis, without warranty of any kind, and the
-- Initial Developer hereby disclaims all such warranties, including without
-- limitation, any warranties of merchantability, fitness for a particular
-- purpose or non-infringement. Please see the License for the specific terms
-- and conditions governing the rights and limitations under the License.
deferred class Viewer from Viewer inherits TShared from MMgt
uses
AsciiString,ExtendedString from TCollection,
GraphicDriver from Graphic3d
is
Initialize( aDriver: GraphicDriver from Graphic3d;
aName: ExtString from Standard;
aDomain: CString from Standard;
aNextCount: Integer from Standard);
Update(me: mutable) is deferred;
Driver(me) returns mutable GraphicDriver from Graphic3d
is static;
---C++: return const &
NextName(me) returns ExtString from Standard
is static;
Domain(me) returns CString from Standard
is static;
IncrCount(me:mutable) is static protected;
fields
myNextCount: Integer from Standard;
myDomain: AsciiString from TCollection;
myName: ExtendedString from TCollection;
myDriver: GraphicDriver from Graphic3d;
end Viewer from Viewer;

View File

@ -1,59 +0,0 @@
// Copyright (c) 1999-2012 OPEN CASCADE SAS
//
// The content of this file is subject to the Open CASCADE Technology Public
// License Version 6.5 (the "License"). You may not use the content of this file
// except in compliance with the License. Please obtain a copy of the License
// at http://www.opencascade.org and read it completely before using this file.
//
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
//
// The Original Code and all software distributed under the License is
// distributed on an "AS IS" basis, without warranty of any kind, and the
// Initial Developer hereby disclaims all such warranties, including without
// limitation, any warranties of merchantability, fitness for a particular
// purpose or non-infringement. Please see the License for the specific terms
// and conditions governing the rights and limitations under the License.
// Modified 27/12/98 : FMN ; PERF: OPTIMISATION LOADER (LOPTIM)
#include <Viewer_Viewer.ixx>
#define LOPTIM
#ifndef LOPTIM
static TCollection_ExtendedString nm;
#else
static TCollection_ExtendedString& _nm() {
static TCollection_ExtendedString nm("");
return nm;
}
#define nm _nm()
#endif // LOPTIM
Viewer_Viewer::Viewer_Viewer(const Handle(Graphic3d_GraphicDriver)& theDriver,
const Standard_ExtString aName,
const Standard_CString aDomain,
const Standard_Integer aNextCount)
:myNextCount(aNextCount),
myDomain(TCollection_AsciiString(aDomain)),
myName(TCollection_ExtendedString(aName)),
myDriver(theDriver)
{}
Standard_CString Viewer_Viewer::Domain() const {
return myDomain.ToCString();
}
const Handle(Graphic3d_GraphicDriver)& Viewer_Viewer::Driver() const {
return myDriver;
}
Standard_ExtString Viewer_Viewer::NextName () const {
nm = TCollection_ExtendedString(myName.ToExtString());
nm.AssignCat(TCollection_ExtendedString(myNextCount));
return nm.ToExtString();
}
void Viewer_Viewer::IncrCount() {
myNextCount++;
}

View File

@ -126,9 +126,7 @@ Handle(Visual3d_Layer) UnderLayer = AView->UnderLayer ();
}
// Begin rendering
Handle(Aspect_GraphicDriver) agd = AView->GraphicDriver ();
theGraphicDriver = *(Handle(Graphic3d_GraphicDriver) *) &agd;
theGraphicDriver = AView->GraphicDriver();
if (theGraphicDriver->BeginImmediatMode
(theCView, UnderCLayer, OverCLayer, DoubleBuffer, RetainMode))
@ -170,10 +168,8 @@ void Visual3d_TransientManager::ClearDraw (const Handle(Visual3d_View)& AView,
OverCLayer = AView->OverLayer()->CLayer();
theCView.ptrOverLayer = (CALL_DEF_LAYER *) &OverCLayer;
}
Handle(Aspect_GraphicDriver) agd = AView->GraphicDriver ();
theGraphicDriver = *(Handle(Graphic3d_GraphicDriver) *) &agd;
theGraphicDriver = AView->GraphicDriver();
theGraphicDriver->ClearImmediatMode (theCView, aFlush);
}
@ -205,9 +201,8 @@ Standard_Boolean Visual3d_TransientManager::BeginAddDraw (const Handle(Visual3d_
OverCLayer = AView->OverLayer()->CLayer();
theCView.ptrOverLayer = (CALL_DEF_LAYER *) &OverCLayer;
}
Handle(Aspect_GraphicDriver) agd = AView->GraphicDriver ();
theGraphicDriver = *(Handle(Graphic3d_GraphicDriver) *) &agd;
theGraphicDriver = AView->GraphicDriver ();
if (theGraphicDriver->BeginAddMode (theCView))
{

View File

@ -75,7 +75,6 @@ uses
Background from Aspect,
GradientBackground from Aspect,
GraphicDriver from Aspect,
Window from Aspect,
TypeOfUpdate from Aspect,
TypeOfHighlightMethod from Aspect,
@ -1050,7 +1049,7 @@ is
---Category: Private methods
GraphicDriver ( me )
returns GraphicDriver from Aspect
returns GraphicDriver from Graphic3d
is static;
---Level: Internal
---Purpose: Returns the associated GraphicDriver.

View File

@ -3524,7 +3524,7 @@ Standard_Boolean Visual3d_View::DegenerateModeIsOn () const {
}
const Handle(Aspect_GraphicDriver)& Visual3d_View::GraphicDriver () const {
const Handle(Graphic3d_GraphicDriver)& Visual3d_View::GraphicDriver () const {
return MyGraphicDriver;