mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0024002: Overall code and build procedure refactoring -- automatic
Automatic upgrade of OCCT code by command "occt_upgrade . -nocdl": - WOK-generated header files from inc and sources from drv are moved to src - CDL files removed - All packages are converted to nocdlpack
This commit is contained in:
@@ -1,77 +1,173 @@
|
||||
Graphic3d_Array1OfVector.hxx
|
||||
Graphic3d_Array1OfVertex.hxx
|
||||
Graphic3d_Array2OfVertex.hxx
|
||||
Graphic3d_ArrayOfPoints.cxx
|
||||
Graphic3d_ArrayOfPoints.hxx
|
||||
Graphic3d_ArrayOfPolygons.cxx
|
||||
Graphic3d_ArrayOfPolygons.hxx
|
||||
Graphic3d_ArrayOfPolylines.cxx
|
||||
Graphic3d_ArrayOfPolylines.hxx
|
||||
Graphic3d_ArrayOfPrimitives.cxx
|
||||
Graphic3d_ArrayOfPrimitives.hxx
|
||||
Graphic3d_ArrayOfPrimitives.lxx
|
||||
Graphic3d_ArrayOfQuadrangles.cxx
|
||||
Graphic3d_ArrayOfQuadrangles.hxx
|
||||
Graphic3d_ArrayOfQuadrangleStrips.cxx
|
||||
Graphic3d_ArrayOfQuadrangleStrips.hxx
|
||||
Graphic3d_ArrayOfSegments.cxx
|
||||
Graphic3d_ArrayOfSegments.hxx
|
||||
Graphic3d_ArrayOfTriangleFans.cxx
|
||||
Graphic3d_ArrayOfTriangleFans.hxx
|
||||
Graphic3d_ArrayOfTriangles.cxx
|
||||
Graphic3d_ArrayOfTriangles.hxx
|
||||
Graphic3d_ArrayOfTriangleStrips.cxx
|
||||
Graphic3d_ArrayOfTriangleStrips.hxx
|
||||
Graphic3d_AspectFillArea3d.cxx
|
||||
Graphic3d_AspectFillArea3d.hxx
|
||||
Graphic3d_AspectLine3d.cxx
|
||||
Graphic3d_AspectLine3d.hxx
|
||||
Graphic3d_AspectMarker3d.cxx
|
||||
Graphic3d_AspectMarker3d.hxx
|
||||
Graphic3d_AspectText3d.cxx
|
||||
Graphic3d_AspectText3d.hxx
|
||||
Graphic3d_AspectTextDefinitionError.hxx
|
||||
Graphic3d_BndBox4d.hxx
|
||||
Graphic3d_BndBox4f.hxx
|
||||
Graphic3d_Buffer.hxx
|
||||
Graphic3d_BoundBuffer.hxx
|
||||
Graphic3d_IndexBuffer.hxx
|
||||
Graphic3d_BSDF.cxx
|
||||
Graphic3d_BSDF.hxx
|
||||
Graphic3d_Buffer.hxx
|
||||
Graphic3d_BufferType.hxx
|
||||
Graphic3d_Camera.cxx
|
||||
Graphic3d_Camera.hxx
|
||||
Graphic3d_CAspectFillArea.hxx
|
||||
Graphic3d_CAspectLine.hxx
|
||||
Graphic3d_CAspectMarker.hxx
|
||||
Graphic3d_CAspectText.hxx
|
||||
Graphic3d_CStructure.cxx
|
||||
Graphic3d_CStructure.hxx
|
||||
Graphic3d_CBitFields4.hxx
|
||||
Graphic3d_CBitFields8.hxx
|
||||
Graphic3d_CBitFields16.hxx
|
||||
Graphic3d_CBitFields20.hxx
|
||||
Graphic3d_CBitFields8.hxx
|
||||
Graphic3d_CBitFields4.hxx
|
||||
Graphic3d_CTexture.hxx
|
||||
Graphic3d_CLight.hxx
|
||||
Graphic3d_ClipPlane.cxx
|
||||
Graphic3d_ClipPlane.hxx
|
||||
Graphic3d_CStructure.cxx
|
||||
Graphic3d_CStructure.hxx
|
||||
Graphic3d_CStructurePtr.hxx
|
||||
Graphic3d_CTexture.hxx
|
||||
Graphic3d_CTransPersStruct.hxx
|
||||
Graphic3d_CUserDraw.hxx
|
||||
Graphic3d_CView.hxx
|
||||
Graphic3d_CycleError.hxx
|
||||
Graphic3d_DataStructure.pxx
|
||||
Graphic3d_DataStructureManager.cxx
|
||||
Graphic3d_DataStructureManager.hxx
|
||||
Graphic3d_ExportFormat.hxx
|
||||
Graphic3d_GraduatedTrihedron.hxx
|
||||
Graphic3d_ViewAffinity.hxx
|
||||
Graphic3d_ViewAffinity.cxx
|
||||
Graphic3d_GraphicDriver.cxx
|
||||
Graphic3d_GraphicDriver.hxx
|
||||
Graphic3d_Group.cxx
|
||||
Graphic3d_Group.hxx
|
||||
Graphic3d_GroupAspect.hxx
|
||||
Graphic3d_GroupDefinitionError.hxx
|
||||
Graphic3d_HorizontalTextAlignment.hxx
|
||||
Graphic3d_HSequenceOfStructure.hxx
|
||||
Graphic3d_IndexBuffer.hxx
|
||||
Graphic3d_IndexedMapOfAddress.hxx
|
||||
Graphic3d_InitialisationError.hxx
|
||||
Graphic3d_LevelOfTextureAnisotropy.hxx
|
||||
Graphic3d_ListIteratorOfListOfShortReal.hxx
|
||||
Graphic3d_ListOfShortReal.hxx
|
||||
Graphic3d_MapIteratorOfMapOfStructure.hxx
|
||||
Graphic3d_MapOfObject.hxx
|
||||
Graphic3d_MapOfStructure.hxx
|
||||
Graphic3d_MarkerImage.cxx
|
||||
Graphic3d_MarkerImage.hxx
|
||||
Graphic3d_Mat4.hxx
|
||||
Graphic3d_Mat4d.hxx
|
||||
Graphic3d_MaterialAspect.cxx
|
||||
Graphic3d_MaterialAspect.hxx
|
||||
Graphic3d_MaterialDefinitionError.hxx
|
||||
Graphic3d_NameOfMaterial.hxx
|
||||
Graphic3d_NameOfTexture1D.hxx
|
||||
Graphic3d_NameOfTexture2D.hxx
|
||||
Graphic3d_NameOfTextureEnv.hxx
|
||||
Graphic3d_NameOfTexturePlane.hxx
|
||||
Graphic3d_NListOfHAsciiString.hxx
|
||||
Graphic3d_NMapOfTransient.hxx
|
||||
Graphic3d_PriorityDefinitionError.hxx
|
||||
Graphic3d_PtrFrameBuffer.hxx
|
||||
Graphic3d_RenderingMode.hxx
|
||||
Graphic3d_RenderingParams.hxx
|
||||
Graphic3d_SequenceOfGroup.hxx
|
||||
Graphic3d_SequenceOfHClipPlane.hxx
|
||||
Graphic3d_SequenceOfStructure.hxx
|
||||
Graphic3d_ShaderObject.cxx
|
||||
Graphic3d_ShaderObject.hxx
|
||||
Graphic3d_ShaderProgram.cxx
|
||||
Graphic3d_ShaderProgram.hxx
|
||||
Graphic3d_ShaderVariable.cxx
|
||||
Graphic3d_ShaderVariable.hxx
|
||||
Graphic3d_ShaderVariable.lxx
|
||||
Graphic3d_SortType.hxx
|
||||
Graphic3d_StereoMode.hxx
|
||||
Graphic3d_Structure.cxx
|
||||
Graphic3d_Structure.hxx
|
||||
Graphic3d_Structure.lxx
|
||||
Graphic3d_Structure.pxx
|
||||
Graphic3d_ShaderObject.hxx
|
||||
Graphic3d_ShaderObject.cxx
|
||||
Graphic3d_ShaderProgram.hxx
|
||||
Graphic3d_ShaderProgram.cxx
|
||||
Graphic3d_ShaderVariable.hxx
|
||||
Graphic3d_ShaderVariable.cxx
|
||||
Graphic3d_ShaderVariable.lxx
|
||||
Graphic3d_StereoMode.hxx
|
||||
Graphic3d_MapOfStructure.hxx
|
||||
Graphic3d_MapIteratorOfMapOfStructure.hxx
|
||||
Graphic3d_IndexedMapOfAddress.hxx
|
||||
Graphic3d_TypeOfShaderObject.hxx
|
||||
Graphic3d_DataStructure.pxx
|
||||
Graphic3d_StructureDefinitionError.hxx
|
||||
Graphic3d_StructureManager.cxx
|
||||
Graphic3d_StructureManager.hxx
|
||||
Graphic3d_StructureManager.pxx
|
||||
Graphic3d.edl
|
||||
Graphic3d_CMPLRS.edl
|
||||
Graphic3d_WOKSteps.edl
|
||||
Graphic3d_StructureManagerPtr.hxx
|
||||
Graphic3d_StructurePtr.hxx
|
||||
Graphic3d_TextPath.hxx
|
||||
Graphic3d_Texture1D.cxx
|
||||
Graphic3d_Texture1D.hxx
|
||||
Graphic3d_Texture1Dmanual.cxx
|
||||
Graphic3d_Texture1Dmanual.hxx
|
||||
Graphic3d_Texture1Dsegment.cxx
|
||||
Graphic3d_Texture1Dsegment.hxx
|
||||
Graphic3d_Texture2D.cxx
|
||||
Graphic3d_Texture2D.hxx
|
||||
Graphic3d_Texture2Dmanual.cxx
|
||||
Graphic3d_Texture2Dmanual.hxx
|
||||
Graphic3d_Texture2Dplane.cxx
|
||||
Graphic3d_Texture2Dplane.hxx
|
||||
Graphic3d_TextureEnv.cxx
|
||||
Graphic3d_TextureEnv.hxx
|
||||
Graphic3d_TextureMap.cxx
|
||||
Graphic3d_TextureMap.hxx
|
||||
Graphic3d_TextureParams.cxx
|
||||
Graphic3d_TextureParams.hxx
|
||||
Graphic3d_TextureRoot.cxx
|
||||
Graphic3d_TextureRoot.hxx
|
||||
Graphic3d_TransformError.hxx
|
||||
Graphic3d_TransModeFlags.hxx
|
||||
Graphic3d_CTransPersStruct.hxx
|
||||
Graphic3d_NListOfHAsciiString.hxx
|
||||
Graphic3d_AspectText3d.cxx
|
||||
Graphic3d_PtrFrameBuffer.hxx
|
||||
Graphic3d_BufferType.hxx
|
||||
Graphic3d_TypeOfBackground.hxx
|
||||
Graphic3d_TypeOfComposition.hxx
|
||||
Graphic3d_TypeOfConnection.hxx
|
||||
Graphic3d_TypeOfMaterial.hxx
|
||||
Graphic3d_TypeOfPolygon.hxx
|
||||
Graphic3d_TypeOfPrimitive.hxx
|
||||
Graphic3d_TypeOfPrimitiveArray.hxx
|
||||
Graphic3d_TypeOfReflection.hxx
|
||||
Graphic3d_TypeOfShaderObject.hxx
|
||||
Graphic3d_TypeOfStructure.hxx
|
||||
Graphic3d_TypeOfTexture.hxx
|
||||
Graphic3d_TypeOfTextureFilter.hxx
|
||||
Graphic3d_TypeOfTextureMode.hxx
|
||||
Graphic3d_Vec.hxx
|
||||
Graphic3d_Vec2.hxx
|
||||
Graphic3d_Vec3.hxx
|
||||
Graphic3d_Vec4.hxx
|
||||
Graphic3d_Mat4.hxx
|
||||
Graphic3d_Mat4d.hxx
|
||||
Graphic3d_Vector.cxx
|
||||
Graphic3d_Vector.hxx
|
||||
Graphic3d_VectorError.hxx
|
||||
Graphic3d_Vertex.cxx
|
||||
Graphic3d_Vertex.hxx
|
||||
Graphic3d_VerticalTextAlignment.hxx
|
||||
Graphic3d_ViewAffinity.cxx
|
||||
Graphic3d_ViewAffinity.hxx
|
||||
Graphic3d_ZLayerId.hxx
|
||||
Graphic3d_ZLayerSettings.hxx
|
||||
Graphic3d_Vertex.hxx
|
||||
Graphic3d_Vertex.cxx
|
||||
Graphic3d_MarkerImage.hxx
|
||||
Graphic3d_MarkerImage.cxx
|
||||
Graphic3d_ClipPlane.hxx
|
||||
Graphic3d_ClipPlane.cxx
|
||||
Graphic3d_SequenceOfGroup.hxx
|
||||
Graphic3d_SequenceOfHClipPlane.hxx
|
||||
Graphic3d_Camera.cxx
|
||||
Graphic3d_Camera.hxx
|
||||
Graphic3d_RenderingParams.hxx
|
||||
Graphic3d_NMapOfTransient.hxx
|
||||
Graphic3d_BSDF.hxx
|
||||
Graphic3d_BSDF.cxx
|
||||
Graphic3d_SequenceOfStructure.hxx
|
||||
Graphic3d_HSequenceOfStructure.hxx
|
||||
Graphic3d_Array1OfVector.hxx
|
||||
Graphic3d_Array1OfVertex.hxx
|
||||
Graphic3d_Array2OfVertex.hxx
|
||||
Graphic3d_ListOfShortReal.hxx
|
||||
Graphic3d_ListIteratorOfListOfShortReal.hxx
|
||||
|
@@ -1,571 +0,0 @@
|
||||
-- Created on: 1993-03-31
|
||||
-- Created by: NW,JPB,CAL
|
||||
-- Copyright (c) 1993-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 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 License 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.
|
||||
|
||||
-- Package : Graphic3d
|
||||
-- Updated : Vendredi 2 Octobre 1992
|
||||
-- Mercredi 31 Mars 1993
|
||||
-- Mercredi 19 Janvier 1994
|
||||
-- 1/08/97 ; PCT : Ajout texture mapping
|
||||
-- 11/97 ; CAL : retrait de la dependance avec math
|
||||
-- 11/97 ; CAL : retrait des DataStructure
|
||||
-- 04/98 ; FGU : ajout champs 'TOR_EMISSION'
|
||||
-- 16-09-98; BGN: (S3819) Ajout TypeOfTriedronEcho,
|
||||
-- TypeOfTriedronPosition.
|
||||
-- 22-09-98; BGN: S3989 (anciennement S3819): report
|
||||
-- dans Aspect des TypeOfTriedron*
|
||||
-- 26-03-99 : FMN ; Compatibilite ascendante:
|
||||
-- Ajout des anciens noms de materiaux.
|
||||
-- 09-04-99 : GG ; Compatibilite ascendante:
|
||||
-- NameOfPhysicalMaterial disparait
|
||||
-- 23-11-99 : GG ; Add material name DEFAULT
|
||||
-- 16-06-2000 : ATS : Study G005: class ArrayOfPrimitives
|
||||
-- and derivated used for model presentation.
|
||||
-- Required: enumeration TypeOfPrimitive;
|
||||
-- imported PrimitiveArray; class PrimitiveList.
|
||||
-- Thanks to Stephane ROUTELOUS
|
||||
-- 20-01-2009 : ABD Integration support of system fonts (using FTGL and FreeType)
|
||||
-- Objective : Specifications definitives
|
||||
|
||||
package Graphic3d
|
||||
|
||||
---Version:
|
||||
|
||||
---Purpose: This package permits the creation of 3d graphic objects
|
||||
-- in a visualiser.
|
||||
-- These objects, called structures, are composed of groups of
|
||||
-- primitives and attributes.
|
||||
-- The group is the smallest editable element of a structure.
|
||||
-- A structure can be displayed, erased, high-lighted.
|
||||
-- A transformation can be applied to it.
|
||||
-- Structures can be connected to form a tree of structures,
|
||||
-- composed by transformations.
|
||||
-- The visualiser permits global manipulation of structures.
|
||||
|
||||
---Keywords: Structure, Group, Primitives, Line, Marker, Text,
|
||||
-- FillAreas, Vertex, Vector, Material, Font, Shading
|
||||
---Warning:
|
||||
---References:
|
||||
|
||||
uses
|
||||
|
||||
TCollection,
|
||||
TColStd,
|
||||
TColgp,
|
||||
OSD,
|
||||
Quantity,
|
||||
Aspect,
|
||||
MMgt,
|
||||
WNT,
|
||||
Image,
|
||||
gp,
|
||||
Font,
|
||||
Bnd
|
||||
is
|
||||
|
||||
-----------------------
|
||||
-- Category: Exceptions
|
||||
-----------------------
|
||||
|
||||
exception AspectTextDefinitionError inherits OutOfRange;
|
||||
---Category: Exceptions
|
||||
|
||||
exception CycleError inherits DomainError;
|
||||
---Category: Exceptions
|
||||
|
||||
exception GroupDefinitionError inherits OutOfRange;
|
||||
---Category: Exceptions
|
||||
|
||||
exception InitialisationError inherits OutOfRange;
|
||||
---Category: Exceptions
|
||||
|
||||
exception MaterialDefinitionError inherits OutOfRange;
|
||||
---Category: Exceptions
|
||||
|
||||
exception PriorityDefinitionError inherits OutOfRange;
|
||||
---Category: Exceptions
|
||||
|
||||
exception StructureDefinitionError inherits OutOfRange;
|
||||
---Category: Exceptions
|
||||
|
||||
exception TransformError inherits OutOfRange;
|
||||
---Category: Exceptions
|
||||
|
||||
exception VectorError inherits OutOfRange;
|
||||
---Category: Exceptions
|
||||
|
||||
-------------------------
|
||||
-- Category: Enumerations
|
||||
-------------------------
|
||||
|
||||
enumeration NameOfMaterial is
|
||||
NOM_BRASS, -- laiton (PHYSIC)
|
||||
NOM_BRONZE, -- bronze (PHYSIC)
|
||||
NOM_COPPER, -- cuivre (PHYSIC)
|
||||
NOM_GOLD, -- or (PHYSIC)
|
||||
|
||||
NOM_PEWTER, -- etain (PHYSIC)
|
||||
|
||||
NOM_PLASTER, -- platre (GENERIC)
|
||||
NOM_PLASTIC, -- plastic (GENERIC)
|
||||
|
||||
NOM_SILVER, -- argent (PHYSIC)
|
||||
|
||||
NOM_STEEL, -- acier (PHYSIC)
|
||||
|
||||
NOM_STONE, -- pierre (PHYSIC)
|
||||
|
||||
NOM_SHINY_PLASTIC, -- plastique brillant (GENERIC)
|
||||
NOM_SATIN, -- satin (GENERIC)
|
||||
NOM_METALIZED, -- metallise New (GENERIC)
|
||||
NOM_NEON_GNC, -- neon New (GENERIC)
|
||||
NOM_CHROME, -- chrome New (PHYSIC)
|
||||
NOM_ALUMINIUM, -- aluminium New (PHYSIC)
|
||||
NOM_OBSIDIAN, -- obsidian New (PHYSIC)
|
||||
NOM_NEON_PHC, -- neon New (PHYSIC)
|
||||
NOM_JADE, -- jade New (PHYSIC)
|
||||
|
||||
NOM_CHARCOAL,
|
||||
|
||||
NOM_WATER,
|
||||
NOM_GLASS,
|
||||
NOM_DIAMOND,
|
||||
|
||||
NOM_DEFAULT,
|
||||
NOM_UserDefined -- owner material
|
||||
end NameOfMaterial;
|
||||
---Purpose: Types of aspect materials.
|
||||
---Category: Enumerations
|
||||
|
||||
enumeration TypeOfMaterial is MATERIAL_ASPECT, -- Materiel generique
|
||||
MATERIAL_PHYSIC -- Materiel physique
|
||||
end TypeOfMaterial;
|
||||
---Purpose: Types of materials specifies if a material can change color.
|
||||
---Category: Enumerations
|
||||
|
||||
enumeration NameOfTexture1D is NOT_1D_ELEVATION,
|
||||
NOT_1D_UNKNOWN
|
||||
end NameOfTexture1D;
|
||||
---Purpose: Types of standard textures.
|
||||
---Category: Enumerations
|
||||
|
||||
|
||||
enumeration NameOfTexture2D is NOT_2D_MATRA,
|
||||
NOT_2D_ALIENSKIN,
|
||||
NOT_2D_BLUE_ROCK,
|
||||
NOT_2D_BLUEWHITE_PAPER,
|
||||
NOT_2D_BRUSHED,
|
||||
NOT_2D_BUBBLES,
|
||||
NOT_2D_BUMP,
|
||||
NOT_2D_CAST,
|
||||
NOT_2D_CHIPBD,
|
||||
NOT_2D_CLOUDS,
|
||||
NOT_2D_FLESH,
|
||||
NOT_2D_FLOOR,
|
||||
NOT_2D_GALVNISD,
|
||||
NOT_2D_GRASS,
|
||||
NOT_2D_ALUMINUM,
|
||||
NOT_2D_ROCK,
|
||||
NOT_2D_KNURL,
|
||||
NOT_2D_MAPLE,
|
||||
NOT_2D_MARBLE,
|
||||
NOT_2D_MOTTLED,
|
||||
NOT_2D_RAIN,
|
||||
NOT_2D_UNKNOWN
|
||||
end NameOfTexture2D;
|
||||
---Purpose: Types of standard textures.
|
||||
---Category: Enumerations
|
||||
|
||||
|
||||
enumeration NameOfTextureEnv is NOT_ENV_CLOUDS,
|
||||
NOT_ENV_CV,
|
||||
NOT_ENV_MEDIT,
|
||||
NOT_ENV_PEARL,
|
||||
NOT_ENV_SKY1,
|
||||
NOT_ENV_SKY2,
|
||||
NOT_ENV_LINES,
|
||||
NOT_ENV_ROAD,
|
||||
NOT_ENV_UNKNOWN
|
||||
end NameOfTextureEnv;
|
||||
---Purpose: Types of standard textures.
|
||||
---Category: Enumerations
|
||||
|
||||
enumeration TypeOfTexture is TOT_1D,
|
||||
TOT_2D,
|
||||
TOT_2D_MIPMAP;
|
||||
---Purpose: Type of the texture file format.
|
||||
---Category: Enumerations
|
||||
|
||||
enumeration TypeOfTextureMode is TOTM_OBJECT,
|
||||
TOTM_SPHERE,
|
||||
TOTM_EYE,
|
||||
TOTM_MANUAL,
|
||||
TOTM_SPRITE;
|
||||
---Purpose: Type of the texture projection.
|
||||
---Category: Enumerations
|
||||
|
||||
enumeration TypeOfTextureFilter is TOTF_NEAREST,
|
||||
TOTF_BILINEAR,
|
||||
TOTF_TRILINEAR;
|
||||
---Purpose: Type of the texture filter.
|
||||
-- Notice that for textures without mipmaps linear interpolation will be used instead of TOTF_BILINEAR and TOTF_TRILINEAR.
|
||||
---Category: Enumerations
|
||||
|
||||
enumeration LevelOfTextureAnisotropy is LOTA_OFF,
|
||||
LOTA_FAST,
|
||||
LOTA_MIDDLE,
|
||||
LOTA_QUALITY;
|
||||
---Purpose: Level of anisotropy filter.
|
||||
-- Notice that actual quality depends on hardware capabilities!
|
||||
---Category: Enumerations
|
||||
|
||||
enumeration NameOfTexturePlane is NOTP_XY,
|
||||
NOTP_YZ,
|
||||
NOTP_ZX,
|
||||
NOTP_UNKNOWN;
|
||||
---Purpose: Type of the texture projection plane for both S and T texture coordinate.
|
||||
---Category: Enumerations
|
||||
|
||||
enumeration TypeOfComposition is TOC_REPLACE,
|
||||
TOC_POSTCONCATENATE
|
||||
end TypeOfComposition;
|
||||
---Purpose: To manage the transformation matrices of structures.
|
||||
---Category: Enumerations
|
||||
|
||||
enumeration TypeOfConnection is TOC_ANCESTOR,
|
||||
TOC_DESCENDANT
|
||||
end TypeOfConnection;
|
||||
---Purpose: To manage the connections between the structures.
|
||||
---Category: Enumerations
|
||||
|
||||
enumeration TypeOfPolygon is TOP_UNKNOWN,
|
||||
TOP_COMPLEX,
|
||||
TOP_CONCAVE,
|
||||
TOP_CONVEX
|
||||
end TypeOfPolygon;
|
||||
---Purpose: The type of polygon in a group in a structure.
|
||||
---Category: Enumerations
|
||||
|
||||
enumeration TypeOfPrimitive is TOP_UNDEFINED,
|
||||
TOP_POLYLINE,
|
||||
TOP_POLYGON,
|
||||
TOP_TRIANGLEMESH,
|
||||
TOP_QUADRANGLEMESH,
|
||||
TOP_TEXT,
|
||||
TOP_MARKER,
|
||||
TOP_PARRAY
|
||||
end TypeOfPrimitive;
|
||||
---Purpose: The type of primitive in a group in a structure.
|
||||
---Category: Enumerations
|
||||
|
||||
enumeration TypeOfPrimitiveArray is TOPA_UNDEFINED,
|
||||
TOPA_POINTS,
|
||||
TOPA_POLYLINES,
|
||||
TOPA_SEGMENTS,
|
||||
TOPA_POLYGONS,
|
||||
TOPA_TRIANGLES,
|
||||
TOPA_QUADRANGLES,
|
||||
TOPA_TRIANGLESTRIPS,
|
||||
TOPA_QUADRANGLESTRIPS,
|
||||
TOPA_TRIANGLEFANS
|
||||
end TypeOfPrimitiveArray;
|
||||
---Purpose: The type of primitive array in a group in a structure.
|
||||
---Category: Enumerations
|
||||
|
||||
enumeration TypeOfReflection is TOR_AMBIENT,
|
||||
TOR_DIFFUSE,
|
||||
TOR_SPECULAR,
|
||||
TOR_EMISSION
|
||||
end TypeOfReflection;
|
||||
---Purpose: Nature of the reflection of a material.
|
||||
---Category: Enumerations
|
||||
|
||||
enumeration TypeOfStructure is TOS_WIREFRAME,
|
||||
TOS_SHADING,
|
||||
TOS_COMPUTED,
|
||||
TOS_ALL
|
||||
end TypeOfStructure;
|
||||
---Purpose: Structural attribute indicating if it can be displayed
|
||||
-- in wireframe, shadow mode, or both.
|
||||
---Category: Enumerations
|
||||
|
||||
enumeration TextPath is TP_UP,
|
||||
TP_DOWN,
|
||||
TP_LEFT,
|
||||
TP_RIGHT
|
||||
end TextPath;
|
||||
---Purpose: Direction in which text is displayed.
|
||||
---Category: Enumerations
|
||||
|
||||
enumeration HorizontalTextAlignment is HTA_LEFT,
|
||||
HTA_CENTER,
|
||||
HTA_RIGHT
|
||||
end HorizontalTextAlignment;
|
||||
---Purpose: Defines the horizontal position of the text
|
||||
-- relative to its anchor.
|
||||
---Category: Enumerations
|
||||
|
||||
enumeration VerticalTextAlignment is VTA_BOTTOM,
|
||||
VTA_CENTER,
|
||||
VTA_TOP
|
||||
end VerticalTextAlignment;
|
||||
---Purpose: Defines the vertical position of the text
|
||||
-- relative to its anchor.
|
||||
---Category: Enumerations
|
||||
|
||||
enumeration GroupAspect is ASPECT_LINE,
|
||||
ASPECT_TEXT,
|
||||
ASPECT_MARKER,
|
||||
ASPECT_FILL_AREA
|
||||
end GroupAspect;
|
||||
---Purpose: Identifies primitives aspects defined per group.
|
||||
-- - ASPECT_LINE: aspect for line primitives;
|
||||
-- - ASPECT_TEXT: aspect for text primitives;
|
||||
-- - ASPECT_MARKER: aspect for marker primitives;
|
||||
-- - ASPECT_FILL_AREA: aspect for face primitives.
|
||||
|
||||
enumeration RenderingMode is
|
||||
RM_RASTERIZATION, RM_RAYTRACING
|
||||
end RenderingMode;
|
||||
---Purpose: Describes rendering modes.
|
||||
-- - RM_RASTERIZATION: enables OpenGL rasterization mode;
|
||||
-- - RM_RAYTRACING: enables GPU ray-tracing mode.
|
||||
|
||||
enumeration TypeOfBackground is
|
||||
TOB_NONE, TOB_GRADIENT, TOB_TEXTURE
|
||||
end TypeOfBackground;
|
||||
---Purpose: Describes type of view background.
|
||||
|
||||
---------------------------
|
||||
-- Category: Imported types
|
||||
---------------------------
|
||||
|
||||
imported BndBox4f;
|
||||
---Purpose: Redefines BVH_Box<Standard_ShortReal, 4> for AABB representation
|
||||
---Category: Imported types
|
||||
imported transient class Buffer;
|
||||
imported transient class BoundBuffer;
|
||||
imported transient class IndexBuffer;
|
||||
|
||||
imported BndBox4d;
|
||||
imported BufferType;
|
||||
|
||||
imported BSDF;
|
||||
|
||||
imported CBitFields20;
|
||||
---Category: Imported types
|
||||
|
||||
imported CBitFields16;
|
||||
---Category: Imported types
|
||||
|
||||
imported CBitFields8;
|
||||
---Category: Imported types
|
||||
|
||||
imported CBitFields4;
|
||||
---Category: Imported types
|
||||
|
||||
imported CAspectFillArea;
|
||||
imported CAspectMarker;
|
||||
imported CAspectLine;
|
||||
imported CAspectText;
|
||||
|
||||
imported transient class CStructure;
|
||||
---Category: Imported types
|
||||
|
||||
pointer CStructurePtr to CStructure from Graphic3d;
|
||||
|
||||
imported CLight;
|
||||
---Category: Imported types
|
||||
|
||||
imported CPlane;
|
||||
---Category: Imported types
|
||||
|
||||
imported CUserDraw;
|
||||
---Category: Imported types
|
||||
|
||||
imported CView;
|
||||
---Category: Imported types
|
||||
|
||||
imported RenderingParams;
|
||||
---Purpose: Describes rendering parameters and effects.
|
||||
---Category: Imported types
|
||||
|
||||
imported GraduatedTrihedron;
|
||||
---Category: Imported types
|
||||
|
||||
imported transient class ClipPlane;
|
||||
---Category: Imported types
|
||||
|
||||
|
||||
imported CTexture;
|
||||
|
||||
imported CTransPersStruct;
|
||||
imported TransModeFlags;
|
||||
|
||||
imported transient class MarkerImage;
|
||||
imported transient class Camera;
|
||||
|
||||
primitive PtrFrameBuffer;
|
||||
primitive Vec2;
|
||||
primitive Vec3;
|
||||
primitive Vec4;
|
||||
imported Mat4;
|
||||
imported Mat4d;
|
||||
|
||||
imported ZLayerSettings;
|
||||
primitive ZLayerId;
|
||||
|
||||
--------------------
|
||||
-- Category: Classes
|
||||
--------------------
|
||||
|
||||
deferred class ArrayOfPrimitives;
|
||||
|
||||
class ArrayOfPoints;
|
||||
|
||||
class ArrayOfPolylines;
|
||||
|
||||
class ArrayOfSegments;
|
||||
|
||||
class ArrayOfPolygons;
|
||||
|
||||
class ArrayOfTriangles;
|
||||
|
||||
class ArrayOfTriangleStrips;
|
||||
|
||||
class ArrayOfTriangleFans;
|
||||
|
||||
class ArrayOfQuadrangles;
|
||||
|
||||
class ArrayOfQuadrangleStrips;
|
||||
|
||||
class AspectLine3d;
|
||||
---Category: Classes
|
||||
|
||||
class AspectFillArea3d;
|
||||
---Category: Classes
|
||||
|
||||
class AspectMarker3d;
|
||||
---Category: Classes
|
||||
|
||||
class AspectText3d;
|
||||
---Category: Classes
|
||||
|
||||
deferred class Group;
|
||||
---Category: Classes
|
||||
|
||||
class MaterialAspect;
|
||||
---Category: Classes
|
||||
|
||||
class Structure;
|
||||
---Category: Classes
|
||||
|
||||
pointer StructurePtr to Structure from Graphic3d;
|
||||
|
||||
deferred class GraphicDriver;
|
||||
|
||||
deferred class StructureManager;
|
||||
---Category: Classes
|
||||
|
||||
pointer StructureManagerPtr to StructureManager from Graphic3d;
|
||||
|
||||
deferred class DataStructureManager;
|
||||
---Category: Classes
|
||||
|
||||
class Vector;
|
||||
---Category: Classes
|
||||
|
||||
imported Vertex;
|
||||
---Category: Classes
|
||||
|
||||
imported transient class ViewAffinity;
|
||||
imported MapOfObject;
|
||||
imported transient class NMapOfTransient;
|
||||
|
||||
imported MapOfStructure;
|
||||
imported IndexedMapOfAddress;
|
||||
imported SequenceOfDisplayedStructures;
|
||||
|
||||
---------------------------------
|
||||
-- Category: Instantiated classes
|
||||
---------------------------------
|
||||
|
||||
imported SequenceOfGroup;
|
||||
|
||||
imported SequenceOfStructure;
|
||||
---Category: Instantiated classes
|
||||
|
||||
imported transient class HSequenceOfStructure;
|
||||
---Category: Instantiated classes
|
||||
|
||||
imported Array1OfVector;
|
||||
---Category: Instantiated classes
|
||||
|
||||
imported Array1OfVertex;
|
||||
---Category: Instantiated classes
|
||||
|
||||
imported Array2OfVertex;
|
||||
---Category: Instantiated classes
|
||||
|
||||
imported ListOfShortReal;
|
||||
|
||||
imported ListIteratorOfListOfShortReal;
|
||||
---Category: Instantiated classes
|
||||
|
||||
--ABD Integration support of system fonts (using FTGL and FreeType)
|
||||
imported NListOfHAsciiString;
|
||||
---Category: Instantiated classes
|
||||
|
||||
imported transient class ShaderProgram;
|
||||
---Category: Instantiated classes
|
||||
|
||||
imported SequenceOfHClipPlane;
|
||||
---Category: Instantiated classes
|
||||
-- Sequence of handles on clip planes
|
||||
|
||||
deferred class TextureRoot from Graphic3d;
|
||||
deferred class TextureMap from Graphic3d;
|
||||
deferred class Texture1D from Graphic3d;
|
||||
deferred class Texture2D from Graphic3d;
|
||||
|
||||
class TextureParams from Graphic3d;
|
||||
class TextureEnv from Graphic3d;
|
||||
class Texture1Dmanual from Graphic3d;
|
||||
class Texture1Dsegment from Graphic3d;
|
||||
class Texture2Dmanual from Graphic3d;
|
||||
class Texture2Dplane from Graphic3d;
|
||||
|
||||
|
||||
enumeration ExportFormat is
|
||||
|
||||
EF_PostScript,
|
||||
EF_EnhPostScript,
|
||||
EF_TEX,
|
||||
EF_PDF,
|
||||
EF_SVG,
|
||||
EF_PGF,
|
||||
EF_EMF
|
||||
|
||||
end ExportFormat;
|
||||
|
||||
|
||||
enumeration SortType is
|
||||
|
||||
ST_Simple, -- sorting by depth of center point of primitive(fast)
|
||||
ST_BSP_Tree -- sorting by BSPTree (slow, but fine result )
|
||||
|
||||
end SortType;
|
||||
|
||||
end Graphic3d;
|
@@ -1,19 +0,0 @@
|
||||
-- Created on: 1996-10-03
|
||||
-- Created by: Jean GAUTIER
|
||||
-- Copyright (c) 1996-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 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 License 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.
|
||||
|
||||
@ifnotdefined ( %Graphic3d_EDL) then
|
||||
@set %Graphic3d_EDL = "";
|
||||
@endif;
|
@@ -1,31 +0,0 @@
|
||||
-- Created on: 2001-01-04
|
||||
-- Copyright (c) 2001-2014 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 License 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.
|
||||
|
||||
class ArrayOfPoints from Graphic3d inherits ArrayOfPrimitives from Graphic3d
|
||||
---Purpose: Contains points array definition
|
||||
|
||||
is
|
||||
|
||||
-- constructor
|
||||
Create (maxVertexs: Integer from Standard;
|
||||
hasVColors: Boolean from Standard = Standard_False;
|
||||
hasVNormals: Boolean from Standard = Standard_False)
|
||||
returns ArrayOfPoints from Graphic3d;
|
||||
---Purpose: Creates an array of points,
|
||||
-- a single pixel point is drawn at each vertex.
|
||||
-- The array must be filled using the AddVertex(Point) method.
|
||||
-- When <hasVColors> is TRUE , you must use only AddVertex(Point,Color) method.
|
||||
-- When <hasVNormals> is TRUE , you must use only AddVertex(Point,Normal) method.
|
||||
|
||||
end;
|
@@ -12,7 +12,9 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Graphic3d_ArrayOfPoints.ixx>
|
||||
|
||||
#include <Graphic3d_ArrayOfPoints.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
Graphic3d_ArrayOfPoints::Graphic3d_ArrayOfPoints (const Standard_Integer theMaxVertexs,
|
||||
const Standard_Boolean theHasVColors,
|
||||
|
66
src/Graphic3d/Graphic3d_ArrayOfPoints.hxx
Normal file
66
src/Graphic3d/Graphic3d_ArrayOfPoints.hxx
Normal file
@@ -0,0 +1,66 @@
|
||||
// Created on: 2001-01-04
|
||||
// Copyright (c) 2001-2014 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 License 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_ArrayOfPoints_HeaderFile
|
||||
#define _Graphic3d_ArrayOfPoints_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Graphic3d_ArrayOfPrimitives.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
|
||||
|
||||
class Graphic3d_ArrayOfPoints;
|
||||
DEFINE_STANDARD_HANDLE(Graphic3d_ArrayOfPoints, Graphic3d_ArrayOfPrimitives)
|
||||
|
||||
//! Contains points array definition
|
||||
class Graphic3d_ArrayOfPoints : public Graphic3d_ArrayOfPrimitives
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates an array of points,
|
||||
//! a single pixel point is drawn at each vertex.
|
||||
//! The array must be filled using the AddVertex(Point) method.
|
||||
//! When <hasVColors> is TRUE , you must use only AddVertex(Point,Color) method.
|
||||
//! When <hasVNormals> is TRUE , you must use only AddVertex(Point,Normal) method.
|
||||
Standard_EXPORT Graphic3d_ArrayOfPoints(const Standard_Integer maxVertexs, const Standard_Boolean hasVColors = Standard_False, const Standard_Boolean hasVNormals = Standard_False);
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Graphic3d_ArrayOfPoints,Graphic3d_ArrayOfPrimitives)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Graphic3d_ArrayOfPoints_HeaderFile
|
@@ -1,114 +0,0 @@
|
||||
-- Created on: 2001-01-04
|
||||
-- Copyright (c) 2001-2014 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 License 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.
|
||||
|
||||
class ArrayOfPolygons from Graphic3d inherits ArrayOfPrimitives from Graphic3d
|
||||
---Purpose: Contains polygons array definition
|
||||
|
||||
is
|
||||
|
||||
-- constructor
|
||||
Create (
|
||||
maxVertexs: Integer from Standard;
|
||||
maxBounds: Integer from Standard = 0;
|
||||
maxEdges: Integer from Standard = 0;
|
||||
hasVNormals: Boolean from Standard = Standard_False;
|
||||
hasVColors: Boolean from Standard = Standard_False;
|
||||
hasBColors: Boolean from Standard = Standard_False;
|
||||
hasTexels: Boolean from Standard = Standard_False)
|
||||
returns ArrayOfPolygons from Graphic3d;
|
||||
---Purpose: Creates an array of polygons,
|
||||
-- a polygon can be filled as:
|
||||
-- 1) creating a single polygon defined with his vertexs.
|
||||
-- i.e:
|
||||
-- myArray = Graphic3d_ArrayOfPolygons(7)
|
||||
-- myArray->AddVertex(x1,y1,z1)
|
||||
-- ....
|
||||
-- myArray->AddVertex(x7,y7,z7)
|
||||
-- 2) creating separate polygons defined with a predefined
|
||||
-- number of bounds and the number of vertex per bound.
|
||||
-- i.e:
|
||||
-- myArray = Graphic3d_ArrayOfPolygons(7,2)
|
||||
-- myArray->AddBound(4)
|
||||
-- myArray->AddVertex(x1,y1,z1)
|
||||
-- ....
|
||||
-- myArray->AddVertex(x4,y4,z4)
|
||||
-- myArray->AddBound(3)
|
||||
-- myArray->AddVertex(x5,y5,z5)
|
||||
-- ....
|
||||
-- myArray->AddVertex(x7,y7,z7)
|
||||
-- 3) creating a single indexed polygon defined with his vertex
|
||||
-- ans edges.
|
||||
-- i.e:
|
||||
-- myArray = Graphic3d_ArrayOfPolygons(4,0,6)
|
||||
-- myArray->AddVertex(x1,y1,z1)
|
||||
-- ....
|
||||
-- myArray->AddVertex(x4,y4,z4)
|
||||
-- myArray->AddEdge(1)
|
||||
-- myArray->AddEdge(2)
|
||||
-- myArray->AddEdge(3)
|
||||
-- myArray->AddEdge(1)
|
||||
-- myArray->AddEdge(2)
|
||||
-- myArray->AddEdge(4)
|
||||
-- 4) creating separate polygons defined with a predefined
|
||||
-- number of bounds and the number of edges per bound.
|
||||
-- i.e:
|
||||
-- myArray = Graphic3d_ArrayOfPolygons(6,4,14)
|
||||
-- myArray->AddBound(3)
|
||||
-- myArray->AddVertex(x1,y1,z1)
|
||||
-- myArray->AddVertex(x2,y2,z2)
|
||||
-- myArray->AddVertex(x3,y3,z3)
|
||||
-- myArray->AddEdge(1)
|
||||
-- myArray->AddEdge(2)
|
||||
-- myArray->AddEdge(3)
|
||||
-- myArray->AddBound(3)
|
||||
-- myArray->AddVertex(x4,y4,z4)
|
||||
-- myArray->AddVertex(x5,y5,z5)
|
||||
-- myArray->AddVertex(x6,y6,z6)
|
||||
-- myArray->AddEdge(4)
|
||||
-- myArray->AddEdge(5)
|
||||
-- myArray->AddEdge(6)
|
||||
-- myArray->AddBound(4)
|
||||
-- myArray->AddEdge(2)
|
||||
-- myArray->AddEdge(3)
|
||||
-- myArray->AddEdge(5)
|
||||
-- myArray->AddEdge(6)
|
||||
-- myArray->AddBound(4)
|
||||
-- myArray->AddEdge(1)
|
||||
-- myArray->AddEdge(3)
|
||||
-- myArray->AddEdge(5)
|
||||
-- myArray->AddEdge(4)
|
||||
-- <maxVertexs> defined the maximun allowed vertex number in the array.
|
||||
-- <maxBounds> defined the maximun allowed bound number in the array.
|
||||
-- <maxEdges> defined the maximun allowed edge number in the array.
|
||||
-- Warning:
|
||||
-- When <hasVNormals> is TRUE , you must use one of
|
||||
-- AddVertex(Point,Normal)
|
||||
-- or AddVertex(Point,Normal,Color)
|
||||
-- or AddVertex(Point,Normal,Texel) methods.
|
||||
-- When <hasVColors> is TRUE , you must use one of
|
||||
-- AddVertex(Point,Color)
|
||||
-- or AddVertex(Point,Normal,Color) methods.
|
||||
-- When <hasTexels> is TRUE , you must use one of
|
||||
-- AddVertex(Point,Texel)
|
||||
-- or AddVertex(Point,Normal,Texel) methods.
|
||||
-- When <hasBColors> is TRUE , <maxBounds> must be > 0 and
|
||||
-- you must use the
|
||||
-- AddBound(number,Color) method.
|
||||
-- Warning:
|
||||
-- the user is responsible about the orientation of the polygon
|
||||
-- depending of the order of the created vertex or edges and this
|
||||
-- orientation must be coherent with the vertex normal optionnaly
|
||||
-- given at each vertex (See the Orientate() methods).
|
||||
|
||||
end;
|
@@ -12,7 +12,9 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Graphic3d_ArrayOfPolygons.ixx>
|
||||
|
||||
#include <Graphic3d_ArrayOfPolygons.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
Graphic3d_ArrayOfPolygons::Graphic3d_ArrayOfPolygons (const Standard_Integer theMaxVertexs,
|
||||
const Standard_Integer theMaxBounds,
|
||||
|
144
src/Graphic3d/Graphic3d_ArrayOfPolygons.hxx
Normal file
144
src/Graphic3d/Graphic3d_ArrayOfPolygons.hxx
Normal file
@@ -0,0 +1,144 @@
|
||||
// Created on: 2001-01-04
|
||||
// Copyright (c) 2001-2014 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 License 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_ArrayOfPolygons_HeaderFile
|
||||
#define _Graphic3d_ArrayOfPolygons_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Graphic3d_ArrayOfPrimitives.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
|
||||
|
||||
class Graphic3d_ArrayOfPolygons;
|
||||
DEFINE_STANDARD_HANDLE(Graphic3d_ArrayOfPolygons, Graphic3d_ArrayOfPrimitives)
|
||||
|
||||
//! Contains polygons array definition
|
||||
class Graphic3d_ArrayOfPolygons : public Graphic3d_ArrayOfPrimitives
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates an array of polygons,
|
||||
//! a polygon can be filled as:
|
||||
//! 1) creating a single polygon defined with his vertexs.
|
||||
//! i.e:
|
||||
//! myArray = Graphic3d_ArrayOfPolygons(7)
|
||||
//! myArray->AddVertex(x1,y1,z1)
|
||||
//! ....
|
||||
//! myArray->AddVertex(x7,y7,z7)
|
||||
//! 2) creating separate polygons defined with a predefined
|
||||
//! number of bounds and the number of vertex per bound.
|
||||
//! i.e:
|
||||
//! myArray = Graphic3d_ArrayOfPolygons(7,2)
|
||||
//! myArray->AddBound(4)
|
||||
//! myArray->AddVertex(x1,y1,z1)
|
||||
//! ....
|
||||
//! myArray->AddVertex(x4,y4,z4)
|
||||
//! myArray->AddBound(3)
|
||||
//! myArray->AddVertex(x5,y5,z5)
|
||||
//! ....
|
||||
//! myArray->AddVertex(x7,y7,z7)
|
||||
//! 3) creating a single indexed polygon defined with his vertex
|
||||
//! ans edges.
|
||||
//! i.e:
|
||||
//! myArray = Graphic3d_ArrayOfPolygons(4,0,6)
|
||||
//! myArray->AddVertex(x1,y1,z1)
|
||||
//! ....
|
||||
//! myArray->AddVertex(x4,y4,z4)
|
||||
//! myArray->AddEdge(1)
|
||||
//! myArray->AddEdge(2)
|
||||
//! myArray->AddEdge(3)
|
||||
//! myArray->AddEdge(1)
|
||||
//! myArray->AddEdge(2)
|
||||
//! myArray->AddEdge(4)
|
||||
//! 4) creating separate polygons defined with a predefined
|
||||
//! number of bounds and the number of edges per bound.
|
||||
//! i.e:
|
||||
//! myArray = Graphic3d_ArrayOfPolygons(6,4,14)
|
||||
//! myArray->AddBound(3)
|
||||
//! myArray->AddVertex(x1,y1,z1)
|
||||
//! myArray->AddVertex(x2,y2,z2)
|
||||
//! myArray->AddVertex(x3,y3,z3)
|
||||
//! myArray->AddEdge(1)
|
||||
//! myArray->AddEdge(2)
|
||||
//! myArray->AddEdge(3)
|
||||
//! myArray->AddBound(3)
|
||||
//! myArray->AddVertex(x4,y4,z4)
|
||||
//! myArray->AddVertex(x5,y5,z5)
|
||||
//! myArray->AddVertex(x6,y6,z6)
|
||||
//! myArray->AddEdge(4)
|
||||
//! myArray->AddEdge(5)
|
||||
//! myArray->AddEdge(6)
|
||||
//! myArray->AddBound(4)
|
||||
//! myArray->AddEdge(2)
|
||||
//! myArray->AddEdge(3)
|
||||
//! myArray->AddEdge(5)
|
||||
//! myArray->AddEdge(6)
|
||||
//! myArray->AddBound(4)
|
||||
//! myArray->AddEdge(1)
|
||||
//! myArray->AddEdge(3)
|
||||
//! myArray->AddEdge(5)
|
||||
//! myArray->AddEdge(4)
|
||||
//! <maxVertexs> defined the maximun allowed vertex number in the array.
|
||||
//! <maxBounds> defined the maximun allowed bound number in the array.
|
||||
//! <maxEdges> defined the maximun allowed edge number in the array.
|
||||
//! Warning:
|
||||
//! When <hasVNormals> is TRUE , you must use one of
|
||||
//! AddVertex(Point,Normal)
|
||||
//! or AddVertex(Point,Normal,Color)
|
||||
//! or AddVertex(Point,Normal,Texel) methods.
|
||||
//! When <hasVColors> is TRUE , you must use one of
|
||||
//! AddVertex(Point,Color)
|
||||
//! or AddVertex(Point,Normal,Color) methods.
|
||||
//! When <hasTexels> is TRUE , you must use one of
|
||||
//! AddVertex(Point,Texel)
|
||||
//! or AddVertex(Point,Normal,Texel) methods.
|
||||
//! When <hasBColors> is TRUE , <maxBounds> must be > 0 and
|
||||
//! you must use the
|
||||
//! AddBound(number,Color) method.
|
||||
//! Warning:
|
||||
//! the user is responsible about the orientation of the polygon
|
||||
//! depending of the order of the created vertex or edges and this
|
||||
//! orientation must be coherent with the vertex normal optionnaly
|
||||
//! given at each vertex (See the Orientate() methods).
|
||||
Standard_EXPORT Graphic3d_ArrayOfPolygons(const Standard_Integer maxVertexs, const Standard_Integer maxBounds = 0, const Standard_Integer maxEdges = 0, const Standard_Boolean hasVNormals = Standard_False, const Standard_Boolean hasVColors = Standard_False, const Standard_Boolean hasBColors = Standard_False, const Standard_Boolean hasTexels = Standard_False);
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Graphic3d_ArrayOfPolygons,Graphic3d_ArrayOfPrimitives)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Graphic3d_ArrayOfPolygons_HeaderFile
|
@@ -1,101 +0,0 @@
|
||||
-- Created on: 2001-01-04
|
||||
-- Copyright (c) 2001-2014 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 License 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.
|
||||
|
||||
class ArrayOfPolylines from Graphic3d inherits ArrayOfPrimitives from Graphic3d
|
||||
---Purpose: Contains polylines array definition
|
||||
|
||||
is
|
||||
|
||||
-- constructor
|
||||
Create (
|
||||
maxVertexs: Integer from Standard;
|
||||
maxBounds: Integer from Standard = 0;
|
||||
maxEdges: Integer from Standard = 0;
|
||||
hasVColors: Boolean from Standard = Standard_False;
|
||||
hasBColors: Boolean from Standard = Standard_False)
|
||||
returns ArrayOfPolylines from Graphic3d;
|
||||
---Purpose: Creates an array of polylines,
|
||||
-- a polyline can be filled as:
|
||||
-- 1) creating a single polyline defined with his vertexs.
|
||||
-- i.e:
|
||||
-- myArray = Graphic3d_ArrayOfPolylines(7)
|
||||
-- myArray->AddVertex(x1,y1,z1)
|
||||
-- ....
|
||||
-- myArray->AddVertex(x7,y7,z7)
|
||||
-- 2) creating separate polylines defined with a predefined
|
||||
-- number of bounds and the number of vertex per bound.
|
||||
-- i.e:
|
||||
-- myArray = Graphic3d_ArrayOfPolylines(7,2)
|
||||
-- myArray->AddBound(4)
|
||||
-- myArray->AddVertex(x1,y1,z1)
|
||||
-- ....
|
||||
-- myArray->AddVertex(x4,y4,z4)
|
||||
-- myArray->AddBound(3)
|
||||
-- myArray->AddVertex(x5,y5,z5)
|
||||
-- ....
|
||||
-- myArray->AddVertex(x7,y7,z7)
|
||||
-- 3) creating a single indexed polyline defined with his vertex
|
||||
-- ans edges.
|
||||
-- i.e:
|
||||
-- myArray = Graphic3d_ArrayOfPolylines(4,0,6)
|
||||
-- myArray->AddVertex(x1,y1,z1)
|
||||
-- ....
|
||||
-- myArray->AddVertex(x4,y4,z4)
|
||||
-- myArray->AddEdge(1)
|
||||
-- myArray->AddEdge(2)
|
||||
-- myArray->AddEdge(3)
|
||||
-- myArray->AddEdge(1)
|
||||
-- myArray->AddEdge(2)
|
||||
-- myArray->AddEdge(4)
|
||||
-- 4) creating separate polylines defined with a predefined
|
||||
-- number of bounds and the number of edges per bound.
|
||||
-- i.e:
|
||||
-- myArray = Graphic3d_ArrayOfPolylines(6,4,14)
|
||||
-- myArray->AddBound(3)
|
||||
-- myArray->AddVertex(x1,y1,z1)
|
||||
-- myArray->AddVertex(x2,y2,z2)
|
||||
-- myArray->AddVertex(x3,y3,z3)
|
||||
-- myArray->AddEdge(1)
|
||||
-- myArray->AddEdge(2)
|
||||
-- myArray->AddEdge(3)
|
||||
-- myArray->AddBound(3)
|
||||
-- myArray->AddVertex(x4,y4,z4)
|
||||
-- myArray->AddVertex(x5,y5,z5)
|
||||
-- myArray->AddVertex(x6,y6,z6)
|
||||
-- myArray->AddEdge(4)
|
||||
-- myArray->AddEdge(5)
|
||||
-- myArray->AddEdge(6)
|
||||
-- myArray->AddBound(4)
|
||||
-- myArray->AddEdge(2)
|
||||
-- myArray->AddEdge(3)
|
||||
-- myArray->AddEdge(5)
|
||||
-- myArray->AddEdge(6)
|
||||
-- myArray->AddBound(4)
|
||||
-- myArray->AddEdge(1)
|
||||
-- myArray->AddEdge(3)
|
||||
-- myArray->AddEdge(5)
|
||||
-- myArray->AddEdge(4)
|
||||
--
|
||||
-- <maxVertexs> defined the maximun allowed vertex number in the array.
|
||||
-- <maxBounds> defined the maximun allowed bound number in the array.
|
||||
-- <maxEdges> defined the maximun allowed edge number in the array.
|
||||
-- Warning:
|
||||
-- When <hasVColors> is TRUE , you must use one of
|
||||
-- AddVertex(Point,Color)
|
||||
-- or AddVertex(Point,Normal,Color) methods.
|
||||
-- When <hasBColors> is TRUE , <maxBounds> must be > 0 and
|
||||
-- you must use the
|
||||
-- AddBound(number,Color) method.
|
||||
|
||||
end;
|
@@ -12,7 +12,9 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Graphic3d_ArrayOfPolylines.ixx>
|
||||
|
||||
#include <Graphic3d_ArrayOfPolylines.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
Graphic3d_ArrayOfPolylines::Graphic3d_ArrayOfPolylines (const Standard_Integer theMaxVertexs,
|
||||
const Standard_Integer theMaxBounds,
|
||||
|
133
src/Graphic3d/Graphic3d_ArrayOfPolylines.hxx
Normal file
133
src/Graphic3d/Graphic3d_ArrayOfPolylines.hxx
Normal file
@@ -0,0 +1,133 @@
|
||||
// Created on: 2001-01-04
|
||||
// Copyright (c) 2001-2014 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 License 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_ArrayOfPolylines_HeaderFile
|
||||
#define _Graphic3d_ArrayOfPolylines_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Graphic3d_ArrayOfPrimitives.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
|
||||
|
||||
class Graphic3d_ArrayOfPolylines;
|
||||
DEFINE_STANDARD_HANDLE(Graphic3d_ArrayOfPolylines, Graphic3d_ArrayOfPrimitives)
|
||||
|
||||
//! Contains polylines array definition
|
||||
class Graphic3d_ArrayOfPolylines : public Graphic3d_ArrayOfPrimitives
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates an array of polylines,
|
||||
//! a polyline can be filled as:
|
||||
//! 1) creating a single polyline defined with his vertexs.
|
||||
//! i.e:
|
||||
//! myArray = Graphic3d_ArrayOfPolylines(7)
|
||||
//! myArray->AddVertex(x1,y1,z1)
|
||||
//! ....
|
||||
//! myArray->AddVertex(x7,y7,z7)
|
||||
//! 2) creating separate polylines defined with a predefined
|
||||
//! number of bounds and the number of vertex per bound.
|
||||
//! i.e:
|
||||
//! myArray = Graphic3d_ArrayOfPolylines(7,2)
|
||||
//! myArray->AddBound(4)
|
||||
//! myArray->AddVertex(x1,y1,z1)
|
||||
//! ....
|
||||
//! myArray->AddVertex(x4,y4,z4)
|
||||
//! myArray->AddBound(3)
|
||||
//! myArray->AddVertex(x5,y5,z5)
|
||||
//! ....
|
||||
//! myArray->AddVertex(x7,y7,z7)
|
||||
//! 3) creating a single indexed polyline defined with his vertex
|
||||
//! ans edges.
|
||||
//! i.e:
|
||||
//! myArray = Graphic3d_ArrayOfPolylines(4,0,6)
|
||||
//! myArray->AddVertex(x1,y1,z1)
|
||||
//! ....
|
||||
//! myArray->AddVertex(x4,y4,z4)
|
||||
//! myArray->AddEdge(1)
|
||||
//! myArray->AddEdge(2)
|
||||
//! myArray->AddEdge(3)
|
||||
//! myArray->AddEdge(1)
|
||||
//! myArray->AddEdge(2)
|
||||
//! myArray->AddEdge(4)
|
||||
//! 4) creating separate polylines defined with a predefined
|
||||
//! number of bounds and the number of edges per bound.
|
||||
//! i.e:
|
||||
//! myArray = Graphic3d_ArrayOfPolylines(6,4,14)
|
||||
//! myArray->AddBound(3)
|
||||
//! myArray->AddVertex(x1,y1,z1)
|
||||
//! myArray->AddVertex(x2,y2,z2)
|
||||
//! myArray->AddVertex(x3,y3,z3)
|
||||
//! myArray->AddEdge(1)
|
||||
//! myArray->AddEdge(2)
|
||||
//! myArray->AddEdge(3)
|
||||
//! myArray->AddBound(3)
|
||||
//! myArray->AddVertex(x4,y4,z4)
|
||||
//! myArray->AddVertex(x5,y5,z5)
|
||||
//! myArray->AddVertex(x6,y6,z6)
|
||||
//! myArray->AddEdge(4)
|
||||
//! myArray->AddEdge(5)
|
||||
//! myArray->AddEdge(6)
|
||||
//! myArray->AddBound(4)
|
||||
//! myArray->AddEdge(2)
|
||||
//! myArray->AddEdge(3)
|
||||
//! myArray->AddEdge(5)
|
||||
//! myArray->AddEdge(6)
|
||||
//! myArray->AddBound(4)
|
||||
//! myArray->AddEdge(1)
|
||||
//! myArray->AddEdge(3)
|
||||
//! myArray->AddEdge(5)
|
||||
//! myArray->AddEdge(4)
|
||||
//!
|
||||
//! <maxVertexs> defined the maximun allowed vertex number in the array.
|
||||
//! <maxBounds> defined the maximun allowed bound number in the array.
|
||||
//! <maxEdges> defined the maximun allowed edge number in the array.
|
||||
//! Warning:
|
||||
//! When <hasVColors> is TRUE , you must use one of
|
||||
//! AddVertex(Point,Color)
|
||||
//! or AddVertex(Point,Normal,Color) methods.
|
||||
//! When <hasBColors> is TRUE , <maxBounds> must be > 0 and
|
||||
//! you must use the
|
||||
//! AddBound(number,Color) method.
|
||||
Standard_EXPORT Graphic3d_ArrayOfPolylines(const Standard_Integer maxVertexs, const Standard_Integer maxBounds = 0, const Standard_Integer maxEdges = 0, const Standard_Boolean hasVColors = Standard_False, const Standard_Boolean hasBColors = Standard_False);
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Graphic3d_ArrayOfPolylines,Graphic3d_ArrayOfPrimitives)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Graphic3d_ArrayOfPolylines_HeaderFile
|
@@ -1,662 +0,0 @@
|
||||
-- Created on: 2000-06-16
|
||||
-- Copyright (c) 2000-2014 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 License 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.
|
||||
|
||||
deferred class ArrayOfPrimitives from Graphic3d inherits TShared
|
||||
|
||||
---Purpose: This class furnish services to defined and fill an
|
||||
-- array of primitives compatible with the use of
|
||||
-- the OPENGl glDrawArrays() or glDrawElements() functions.
|
||||
-- NOTE that the main goal of this kind of primitive
|
||||
-- is to avoid multiple copies of datas between
|
||||
-- each layer of the software.
|
||||
-- So the array datas exist only one time and the use
|
||||
-- of SetXxxxxx() methods enable to change dynamically
|
||||
-- the aspect of this primitive.
|
||||
--
|
||||
-- Advantages are :
|
||||
-- 1) Decrease strongly the loading time.
|
||||
-- 2) Decrease strongly the display time using optimized Opengl
|
||||
-- primitives.
|
||||
-- 3) Enable to change dynamically the components of the primitive
|
||||
-- (vertice,normal,color,texture coordinates).
|
||||
-- 4) Add true triangle and quadrangle strips or fans capabilities.
|
||||
|
||||
uses
|
||||
|
||||
TypeOfPrimitiveArray from Graphic3d,
|
||||
Buffer from Graphic3d,
|
||||
BoundBuffer from Graphic3d,
|
||||
IndexBuffer from Graphic3d,
|
||||
Vec3 from Graphic3d,
|
||||
Color from Quantity,
|
||||
Pnt from gp,
|
||||
Pnt2d from gp,
|
||||
Dir from gp
|
||||
|
||||
raises
|
||||
OutOfRange from Standard,
|
||||
InitialisationError from Graphic3d
|
||||
|
||||
is
|
||||
|
||||
-- constructor
|
||||
Initialize (
|
||||
aType: TypeOfPrimitiveArray from Graphic3d;
|
||||
maxVertexs: Integer from Standard;
|
||||
maxBounds: Integer from Standard;
|
||||
maxEdges: Integer from Standard;
|
||||
hasVNormals: Boolean from Standard;
|
||||
hasVColors: Boolean from Standard;
|
||||
hasBColors: Boolean from Standard;
|
||||
hasTexels: Boolean from Standard)
|
||||
returns ArrayOfPrimitives from Graphic3d
|
||||
raises InitialisationError from Graphic3d;
|
||||
---Purpose: Warning
|
||||
-- You must use a coherent set of AddVertex() methods according to the
|
||||
-- <hasVNormals>,<hasVColors>,<hasVTexels>,<hasBColors>
|
||||
-- User is responsible of confuse vertex and bad normal orientation.
|
||||
-- You must use AddBound() method only if the <maxBounds>
|
||||
-- constructor parameter is > 0.
|
||||
-- You must use AddEdge() method only if the <maxEdges>
|
||||
-- constructor parameter is > 0.
|
||||
|
||||
Destroy( me: mutable);
|
||||
-- destructor
|
||||
---C++: alias ~
|
||||
|
||||
-- -------------------------------------------------------------------
|
||||
-- Methods to fill array
|
||||
-- -------------------------------------------------------------------
|
||||
|
||||
AddVertex( me:mutable;
|
||||
aVertice: Pnt from gp)
|
||||
returns Integer from Standard
|
||||
---Level: Public
|
||||
---Purpose: Adds a vertice in the array.
|
||||
-- returns the actual vertex number.
|
||||
raises OutOfRange from Standard;
|
||||
-- if the actual vertex number is >= <maxVertexs>
|
||||
---C++: inline
|
||||
---C++: alias "Standard_Integer AddVertex (const Graphic3d_Vec3& theVertex);"
|
||||
|
||||
AddVertex( me:mutable;
|
||||
X,Y,Z: Real from Standard)
|
||||
returns Integer from Standard
|
||||
---Level: Public
|
||||
---Purpose: Adds a vertice in the array.
|
||||
-- returns the actual vertex number.
|
||||
raises OutOfRange from Standard;
|
||||
-- if the actual vertex number is >= <maxVertexs>
|
||||
---C++: inline
|
||||
|
||||
AddVertex( me:mutable;
|
||||
X,Y,Z: ShortReal from Standard)
|
||||
returns Integer from Standard
|
||||
---Level: Public
|
||||
---Purpose: Adds a vertice in the array.
|
||||
-- returns the actual vertex number.
|
||||
raises OutOfRange from Standard;
|
||||
-- if the actual vertex number is >= <maxVertexs>
|
||||
|
||||
AddVertex( me:mutable;
|
||||
aVertice: Pnt from gp;
|
||||
aColor: Color from Quantity)
|
||||
returns Integer from Standard
|
||||
---Level: Public
|
||||
---Purpose: Adds a vertice and vertex color in the vertex array.
|
||||
-- returns the actual vertex number.
|
||||
-- Warning: <aColor> is ignored when the <hasVColors>
|
||||
-- constructor parameter is FALSE
|
||||
raises OutOfRange from Standard;
|
||||
-- if the actual vertex number is >= <maxVertexs>
|
||||
|
||||
AddVertex( me : mutable;
|
||||
aVertice : Pnt from gp;
|
||||
aColor : Integer from Standard)
|
||||
returns Integer from Standard
|
||||
---Level: Public
|
||||
---Purpose: Adds a vertice and vertex color in the vertex array.
|
||||
-- returns the actual vertex number.
|
||||
-- Warning: <aColor> is ignored when the <hasVColors>
|
||||
-- constructor parameter is FALSE
|
||||
-- aColor = Alpha << 24 + Blue << 16 + Green << 8 + Red
|
||||
-- On all architecture proccers type (x86 or SPARC) you can
|
||||
-- use this byte order.
|
||||
raises OutOfRange from Standard;
|
||||
-- if the actual vertex number is >= <maxVertexs>
|
||||
|
||||
AddVertex( me :mutable;
|
||||
aVertice : Pnt from gp;
|
||||
aNormal : Dir from gp)
|
||||
returns Integer from Standard
|
||||
---Level: Public
|
||||
---Purpose: Adds a vertice and vertex normal in the vertex array.
|
||||
-- returns the actual vertex number.
|
||||
-- Warning: <aNormal> is ignored when the <hasVNormals>
|
||||
-- constructor parameter is FALSE.
|
||||
raises OutOfRange from Standard;
|
||||
-- if the actual vertex number is >= <maxVertexs>
|
||||
---C++: inline
|
||||
|
||||
AddVertex( me:mutable;
|
||||
X,Y,Z: Real from Standard;
|
||||
NX,NY,NZ: Real from Standard)
|
||||
returns Integer from Standard
|
||||
---Level: Public
|
||||
---Purpose: Adds a vertice and vertex normal in the vertex array.
|
||||
-- returns the actual vertex number.
|
||||
-- Warning: <aNormal> is ignored when the <hasVNormals>
|
||||
-- constructor parameter is FALSE.
|
||||
raises OutOfRange from Standard;
|
||||
-- if the actual vertex number is >= <maxVertexs>
|
||||
---C++: inline
|
||||
|
||||
AddVertex( me:mutable;
|
||||
X,Y,Z: ShortReal from Standard;
|
||||
NX,NY,NZ: ShortReal from Standard)
|
||||
returns Integer from Standard
|
||||
---Level: Public
|
||||
---Purpose: Adds a vertice and vertex normal in the vertex array.
|
||||
-- returns the actual vertex number.
|
||||
-- Warning: <aNormal> is ignored when the <hasVNormals>
|
||||
-- constructor parameter is FALSE.
|
||||
raises OutOfRange from Standard;
|
||||
-- if the actual vertex number is >= <maxVertexs>
|
||||
|
||||
AddVertex( me:mutable;
|
||||
aVertice: Pnt from gp;
|
||||
aNormal: Dir from gp;
|
||||
aColor: Color from Quantity)
|
||||
returns Integer from Standard
|
||||
---Level: Public
|
||||
---Purpose: Adds a vertice,vertex normal and color in the vertex array.
|
||||
-- returns the actual vertex number.
|
||||
-- Warning: <aNormal> is ignored when the <hasVNormals>
|
||||
-- constructor parameter is FALSE.
|
||||
-- <aColor> is ignored when the <hasVColors>
|
||||
-- constructor parameter is FALSE
|
||||
raises OutOfRange from Standard;
|
||||
-- if the actual vertex number is >= <maxVertexs>
|
||||
|
||||
AddVertex( me : mutable;
|
||||
aVertice : Pnt from gp;
|
||||
aNormal : Dir from gp;
|
||||
aColor : Integer from Standard)
|
||||
returns Integer from Standard
|
||||
---Level: Public
|
||||
---Purpose: Adds a vertice,vertex normal and color in the vertex array.
|
||||
-- returns the actual vertex number.
|
||||
-- Warning: <aNormal> is ignored when the <hasVNormals>
|
||||
-- constructor parameter is FALSE.
|
||||
-- <aColor> is ignored when the <hasVColors>
|
||||
-- constructor parameter is FALSE
|
||||
-- aColor = Alpha << 24 + Blue << 16 + Green << 8 + Red
|
||||
-- On all architecture proccers type (x86 or SPARC) you can
|
||||
-- use this byte order.
|
||||
raises OutOfRange from Standard;
|
||||
-- if the actual vertex number is >= <maxVertexs>
|
||||
|
||||
AddVertex( me:mutable;
|
||||
aVertice: Pnt from gp;
|
||||
aTexel: Pnt2d from gp)
|
||||
returns Integer from Standard
|
||||
---Level: Public
|
||||
---Purpose: Adds a vertice and vertex texture in the vertex array.
|
||||
-- returns the actual vertex number.
|
||||
-- <aTexel> is ignored when the <hasVTexels>
|
||||
-- constructor parameter is FALSE.
|
||||
raises OutOfRange from Standard;
|
||||
-- if the actual vertex number is >= <maxVertexs>
|
||||
---C++: inline
|
||||
|
||||
AddVertex( me:mutable;
|
||||
X,Y,Z: Real from Standard;
|
||||
TX,TY: Real from Standard)
|
||||
returns Integer from Standard
|
||||
---Level: Public
|
||||
---Purpose: Adds a vertice and vertex texture coordinates in the vertex array.
|
||||
-- returns the actual vertex number.
|
||||
-- <aTexel> is ignored when the <hasVTexels>
|
||||
-- constructor parameter is FALSE.
|
||||
raises OutOfRange from Standard;
|
||||
-- if the actual vertex number is >= <maxVertexs>
|
||||
---C++: inline
|
||||
|
||||
AddVertex( me:mutable;
|
||||
X,Y,Z: ShortReal from Standard;
|
||||
TX,TY: ShortReal from Standard)
|
||||
returns Integer from Standard
|
||||
---Level: Public
|
||||
---Purpose: Adds a vertice and vertex texture coordinates in the vertex array.
|
||||
-- returns the actual vertex number.
|
||||
-- <aTexel> is ignored when the <hasVTexels>
|
||||
-- constructor parameter is FALSE.
|
||||
raises OutOfRange from Standard;
|
||||
-- if the actual vertex number is >= <maxVertexs>
|
||||
|
||||
AddVertex( me:mutable;
|
||||
aVertice: Pnt from gp;
|
||||
aNormal: Dir from gp;
|
||||
aTexel: Pnt2d from gp)
|
||||
returns Integer from Standard
|
||||
---Level: Public
|
||||
---Purpose: Adds a vertice,vertex normal and texture in the vertex array.
|
||||
-- returns the actual vertex number.
|
||||
-- Warning: <aNormal> is ignored when the <hasVNormals>
|
||||
-- constructor parameter is FALSE.
|
||||
-- <aTexel> is ignored when the <hasVTexels>
|
||||
-- constructor parameter is FALSE.
|
||||
raises OutOfRange from Standard;
|
||||
-- if the actual vertex number is >= <maxVertexs>
|
||||
---C++: inline
|
||||
|
||||
AddVertex( me:mutable;
|
||||
X,Y,Z: Real from Standard;
|
||||
NX,NY,NZ: Real from Standard;
|
||||
TX,TY: Real from Standard)
|
||||
returns Integer from Standard
|
||||
---Level: Public
|
||||
---Purpose: Adds a vertice,vertex normal and texture in the vertex array.
|
||||
-- returns the actual vertex number.
|
||||
-- Warning: <aNormal> is ignored when the <hasVNormals>
|
||||
-- constructor parameter is FALSE.
|
||||
-- <aTexel> is ignored when the <hasVTexels>
|
||||
-- constructor parameter is FALSE.
|
||||
raises OutOfRange from Standard;
|
||||
-- if the actual vertex number is >= <maxVertexs>
|
||||
---C++: inline
|
||||
|
||||
AddVertex( me:mutable;
|
||||
X,Y,Z: ShortReal from Standard;
|
||||
NX,NY,NZ: ShortReal from Standard;
|
||||
TX,TY: ShortReal from Standard)
|
||||
returns Integer from Standard
|
||||
---Level: Public
|
||||
---Purpose: Adds a vertice,vertex normal and texture in the vertex array.
|
||||
-- returns the actual vertex number.
|
||||
-- Warning: <aNormal> is ignored when the <hasVNormals>
|
||||
-- constructor parameter is FALSE.
|
||||
-- <aTexel> is ignored when the <hasVTexels>
|
||||
-- constructor parameter is FALSE.
|
||||
raises OutOfRange from Standard;
|
||||
-- if the actual vertex number is >= <maxVertexs>
|
||||
|
||||
AddBound( me:mutable;
|
||||
edgeNumber: Integer from Standard)
|
||||
returns Integer from Standard
|
||||
---Level: Public
|
||||
---Purpose: Adds a bound of length <edgeNumber> in the bound array
|
||||
-- returns the actual bounds number.
|
||||
raises OutOfRange from Standard;
|
||||
-- if the actual Bound number is >= <maxBounds>
|
||||
|
||||
AddBound( me:mutable;
|
||||
edgeNumber: Integer from Standard;
|
||||
aBColor: Color from Quantity)
|
||||
returns Integer from Standard
|
||||
---Level: Public
|
||||
---Purpose: Adds a bound of length <edgeNumber> and bound color
|
||||
-- <aBColor> in the bound array.
|
||||
-- returns the actual bounds number.
|
||||
-- Warning: <aBColor> is ignored when the <hasBColors>
|
||||
-- constructor parameter is FALSE
|
||||
raises OutOfRange from Standard;
|
||||
-- if the actual Bound number is >= <maxBounds>
|
||||
|
||||
AddBound( me:mutable;
|
||||
edgeNumber: Integer from Standard;
|
||||
R,G,B: Real from Standard)
|
||||
returns Integer from Standard
|
||||
---Level: Public
|
||||
---Purpose: Adds a bound of length <edgeNumber> and bound color
|
||||
-- coordinates in the bound array.
|
||||
-- returns the actual bounds number.
|
||||
-- Warning: <R,G,B> are ignored when the <hasBColors>
|
||||
-- constructor parameter is FALSE
|
||||
raises OutOfRange from Standard;
|
||||
-- if the actual Bound number is >= <maxBounds>
|
||||
|
||||
AddEdge( me:mutable;
|
||||
vertexIndex: Integer from Standard)
|
||||
returns Integer from Standard
|
||||
---Level: Public
|
||||
---Purpose: Adds an edge in the range [1,VertexNumber()] in the array.
|
||||
-- Returns the actual edges number.
|
||||
raises OutOfRange from Standard;
|
||||
-- if the actual edge number is >= <maxEdges>
|
||||
|
||||
-- -------------------------------------------------------------------
|
||||
-- Methods to modify the array
|
||||
-- -------------------------------------------------------------------
|
||||
|
||||
SetVertice( me:mutable;
|
||||
anIndex: Integer from Standard;
|
||||
aVertice: Pnt from gp)
|
||||
---Level: Public
|
||||
---Purpose: Change the vertice of rank <anIndex> in the array.
|
||||
raises OutOfRange from Standard;
|
||||
-- if the index is <1 or > VertexNumber()
|
||||
|
||||
SetVertice( me:mutable;
|
||||
anIndex: Integer from Standard;
|
||||
X,Y,Z: ShortReal from Standard)
|
||||
---Level: Public
|
||||
---Purpose: Change the vertice of rank <anIndex> in the array.
|
||||
raises OutOfRange from Standard;
|
||||
-- if the index is <1 or > VertexNumber()
|
||||
---C++: inline
|
||||
|
||||
SetVertexColor( me : mutable;
|
||||
anIndex : Integer from Standard;
|
||||
aColor : Color from Quantity)
|
||||
---Level: Public
|
||||
---Purpose: Change the vertex color of rank <anIndex> in the array.
|
||||
raises OutOfRange from Standard;
|
||||
-- if the index is <1 or > VertexNumber()
|
||||
|
||||
SetVertexColor( me : mutable;
|
||||
anIndex : Integer from Standard;
|
||||
R,G,B : Real from Standard)
|
||||
---Level: Public
|
||||
---Purpose: Change the vertex color of rank <anIndex> in the array.
|
||||
raises OutOfRange from Standard;
|
||||
-- if the index is <1 or > VertexNumber()
|
||||
---C++: inline
|
||||
|
||||
SetVertexColor( me : mutable;
|
||||
anIndex : Integer from Standard;
|
||||
aColor : Integer from Standard)
|
||||
---Level: Public
|
||||
---Purpose: Change the vertex color of rank <anIndex> in the array.
|
||||
-- aColor = Alpha << 24 + Blue << 16 + Green << 8 + Red
|
||||
-- On all architecture proccers type (x86 or SPARC) you can
|
||||
-- use this byte order.
|
||||
raises OutOfRange from Standard;
|
||||
-- if the index is <1 or > VertexNumber()
|
||||
|
||||
|
||||
SetVertexNormal( me : mutable;
|
||||
anIndex : Integer from Standard;
|
||||
aNormal : Dir from gp)
|
||||
---Level: Public
|
||||
---Purpose: Change the vertex normal of rank <anIndex> in the array.
|
||||
raises OutOfRange from Standard;
|
||||
-- if the index is <1 or > VertexNumber()
|
||||
|
||||
SetVertexNormal( me : mutable;
|
||||
anIndex : Integer from Standard;
|
||||
NX,NY,NZ: Real from Standard)
|
||||
---Level: Public
|
||||
---Purpose: Change the vertex normal of rank <anIndex> in the array.
|
||||
raises OutOfRange from Standard;
|
||||
-- if the index is <1 or > VertexNumber()
|
||||
---C++: inline
|
||||
|
||||
SetVertexTexel( me:mutable;
|
||||
anIndex: Integer from Standard;
|
||||
aTexel: Pnt2d from gp)
|
||||
---Level: Public
|
||||
---Purpose: Change the vertex texel of rank <anIndex> in the array.
|
||||
raises OutOfRange from Standard;
|
||||
-- if the index is <1 or > VertexNumber()
|
||||
|
||||
SetVertexTexel( me:mutable;
|
||||
anIndex: Integer from Standard;
|
||||
TX,TY: Real from Standard)
|
||||
---Level: Public
|
||||
---Purpose: Change the vertex texel of rank <anIndex> in the array.
|
||||
raises OutOfRange from Standard;
|
||||
-- if the index is <1 or > VertexNumber()
|
||||
---C++: inline
|
||||
|
||||
SetBoundColor( me:mutable;
|
||||
anIndex: Integer from Standard;
|
||||
aColor: Color from Quantity)
|
||||
---Level: Public
|
||||
---Purpose: Change the bound color of rank <anIndex> in the array.
|
||||
raises OutOfRange from Standard;
|
||||
-- if the index is <1 or > BoundNumber()
|
||||
|
||||
SetBoundColor( me:mutable;
|
||||
anIndex: Integer from Standard;
|
||||
R,G,B: Real from Standard)
|
||||
---Level: Public
|
||||
---Purpose: Change the bound color of rank <anIndex> in the array.
|
||||
raises OutOfRange from Standard;
|
||||
-- if the index is <1 or > BoundNumber()
|
||||
---C++: inline
|
||||
|
||||
-------------------------------------------------------------------
|
||||
-- Category Inquiries on array
|
||||
-------------------------------------------------------------------
|
||||
|
||||
Indices (me)
|
||||
returns IndexBuffer from Graphic3d;
|
||||
---Purpose: Returns optional index buffer.
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
|
||||
Attributes (me)
|
||||
returns Buffer from Graphic3d;
|
||||
---Purpose: Returns vertex attributes buffer (colors, normals, texture coordinates).
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
|
||||
Bounds (me)
|
||||
returns BoundBuffer from Graphic3d;
|
||||
---Purpose: Returns optional bounds buffer.
|
||||
---C++: inline
|
||||
---C++: return const &
|
||||
|
||||
Type( me )
|
||||
returns TypeOfPrimitiveArray from Graphic3d;
|
||||
---Level: Public
|
||||
---Purpose: Returns the type of this primitive
|
||||
---C++: inline
|
||||
|
||||
StringType( me )
|
||||
returns CString from Standard;
|
||||
---Level: Public
|
||||
---Purpose: Returns the string type of this primitive
|
||||
|
||||
HasVertexNormals( me )
|
||||
returns Boolean from Standard;
|
||||
---Level: Public
|
||||
---Purpose: Returns TRUE when vertex normals array is defined.
|
||||
---C++: inline
|
||||
|
||||
HasVertexColors( me )
|
||||
returns Boolean from Standard;
|
||||
---Level: Public
|
||||
---Purpose: Returns TRUE when vertex colors array is defined.
|
||||
---C++: inline
|
||||
|
||||
HasVertexTexels( me )
|
||||
returns Boolean from Standard;
|
||||
---Level: Public
|
||||
---Purpose: Returns TRUE when vertex texels array is defined.
|
||||
---C++: inline
|
||||
|
||||
VertexNumber( me )
|
||||
returns Integer from Standard;
|
||||
---Level: Public
|
||||
---Purpose: Returns the number of defined vertex
|
||||
---C++: inline
|
||||
|
||||
Vertice( me ; aRank: Integer from Standard)
|
||||
returns Pnt from gp
|
||||
---Level: Public
|
||||
---Purpose: Returns the vertice at rank <aRank>
|
||||
-- from the vertex table if defined.
|
||||
raises OutOfRange from Standard;
|
||||
-- when the rank is < 1 or > VertexNumber().
|
||||
|
||||
Vertice( me ; aRank: Integer from Standard;
|
||||
X,Y,Z: out Real from Standard)
|
||||
---Level: Public
|
||||
---Purpose: Returns the vertice coordinates at rank <aRank>
|
||||
-- from the vertex table if defined.
|
||||
raises OutOfRange from Standard;
|
||||
-- when the rank is < 1 or > VertexNumber().
|
||||
---C++: inline
|
||||
|
||||
VertexColor( me ; aRank: Integer from Standard)
|
||||
returns Color from Quantity
|
||||
---Level: Public
|
||||
---Purpose: Returns the vertex color at rank <aRank>
|
||||
-- from the vertex table if defined.
|
||||
raises OutOfRange from Standard;
|
||||
-- when the rank is < 1 or > VertexNumber().
|
||||
|
||||
VertexColor( me ; aRank : Integer from Standard;
|
||||
R, G, B : out Real from Standard)
|
||||
---Level: Public
|
||||
---Purpose: Returns the vertex color values at rank <aRank>
|
||||
-- from the vertex table if defined.
|
||||
raises OutOfRange from Standard;
|
||||
-- when the rank is < 1 or > VertexNumber().
|
||||
---C++: inline
|
||||
|
||||
VertexColor( me ; aRank: Integer from Standard;
|
||||
aColor: out Integer from Standard)
|
||||
---Level: Public
|
||||
---Purpose: Returns the vertex color values at rank <aRank>
|
||||
-- from the vertex table if defined.
|
||||
raises OutOfRange from Standard;
|
||||
-- when the rank is < 1 or > VertexNumber().
|
||||
---C++: inline
|
||||
|
||||
|
||||
VertexNormal( me ; aRank: Integer from Standard)
|
||||
returns Dir from gp
|
||||
---Level: Public
|
||||
---Purpose: Returns the vertex normal at rank <aRank>
|
||||
-- from the vertex table if defined.
|
||||
raises OutOfRange from Standard;
|
||||
-- when the rank is < 1 or > VertexNumber().
|
||||
|
||||
VertexNormal( me ; aRank: Integer from Standard;
|
||||
NX,NY,NZ: out Real from Standard)
|
||||
---Level: Public
|
||||
---Purpose: Returns the vertex normal coordinates at rank <aRank>
|
||||
-- from the vertex table if defined.
|
||||
raises OutOfRange from Standard;
|
||||
-- when the rank is < 1 or > VertexNumber().
|
||||
---C++: inline
|
||||
|
||||
VertexTexel( me ; aRank: Integer from Standard)
|
||||
returns Pnt2d from gp
|
||||
---Level: Public
|
||||
---Purpose: Returns the vertex texture at rank <aRank>
|
||||
-- from the vertex table if defined.
|
||||
raises OutOfRange from Standard;
|
||||
-- when the rank is < 1 or > VertexNumber().
|
||||
|
||||
VertexTexel( me ; aRank: Integer from Standard;
|
||||
TX,TY: out Real from Standard)
|
||||
---Level: Public
|
||||
---Purpose: Returns the vertex texture coordinates at rank <aRank>
|
||||
-- from the vertex table if defined.
|
||||
raises OutOfRange from Standard;
|
||||
-- when the rank is < 1 or > VertexNumber().
|
||||
---C++: inline
|
||||
|
||||
EdgeNumber( me )
|
||||
returns Integer from Standard;
|
||||
---Level: Public
|
||||
---Purpose: Returns the number of defined edges
|
||||
---C++: inline
|
||||
|
||||
Edge( me ; aRank: Integer from Standard)
|
||||
returns Integer from Standard
|
||||
---Level: Public
|
||||
---Purpose: Returns the vertex index at rank <aRank>
|
||||
-- in the range [1,VertexNumber()]
|
||||
raises OutOfRange from Standard;
|
||||
-- when the rank is < 1 or > EdgeNumber()
|
||||
---C++: inline
|
||||
|
||||
HasBoundColors( me )
|
||||
returns Boolean from Standard;
|
||||
---Level: Public
|
||||
---Purpose: Returns TRUE when bound colors array is defined.
|
||||
---C++: inline
|
||||
|
||||
BoundNumber( me )
|
||||
returns Integer from Standard;
|
||||
---Level: Public
|
||||
---Purpose: Returns the number of defined bounds
|
||||
---C++: inline
|
||||
|
||||
Bound( me ; aRank: Integer from Standard)
|
||||
returns Integer from Standard
|
||||
---Level: Public
|
||||
---Purpose: Returns the edge number at rank <aRank>.
|
||||
raises OutOfRange from Standard;
|
||||
-- when the rank is < 1 or > BoundNumber()
|
||||
---C++: inline
|
||||
|
||||
BoundColor( me ; aRank: Integer from Standard)
|
||||
returns Color from Quantity
|
||||
---Level: Public
|
||||
---Purpose: Returns the bound color at rank <aRank>
|
||||
-- from the bound table if defined.
|
||||
raises OutOfRange from Standard;
|
||||
-- when the rank is < 1 or > BoundNumber()
|
||||
|
||||
BoundColor( me ; aRank: Integer from Standard;
|
||||
R,G,B: out Real from Standard)
|
||||
---Level: Public
|
||||
---Purpose: Returns the bound color values at rank <aRank>
|
||||
-- from the bound table if defined.
|
||||
raises OutOfRange from Standard;
|
||||
-- when the rank is < 1 or > BoundNumber()
|
||||
|
||||
ItemNumber( me )
|
||||
returns Integer from Standard;
|
||||
---Level: Public
|
||||
---Purpose: Returns the number of total items according to
|
||||
-- the array type.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
-- Category Miscellaneous
|
||||
-------------------------------------------------------------------
|
||||
|
||||
IsValid( me:mutable )
|
||||
returns Boolean from Standard;
|
||||
---Level: Public
|
||||
---Purpose: Returns TRUE only when the contains of this array is
|
||||
-- available.
|
||||
|
||||
ComputeVNormals( me:mutable ; fromIndex,toIndex: Integer from Standard)
|
||||
is private;
|
||||
|
||||
fields
|
||||
|
||||
myIndices : IndexBuffer from Graphic3d; -- optional index buffer
|
||||
myAttribs : Buffer from Graphic3d; -- vertex attributes buffer (colors, normals, texture coordinates)
|
||||
myBounds : BoundBuffer from Graphic3d; -- vertex attributes buffer (colors, normals, texture coordinates)
|
||||
|
||||
myType : TypeOfPrimitiveArray from Graphic3d;
|
||||
|
||||
myMaxBounds : Integer from Standard;
|
||||
myMaxVertexs : Integer from Standard;
|
||||
myMaxEdges : Integer from Standard;
|
||||
myVNor : Byte from Standard; -- offset to normal attribute
|
||||
myVTex : Byte from Standard; -- offset to texel attribute
|
||||
myVCol : Byte from Standard; -- offset to color attribute
|
||||
|
||||
friends
|
||||
class Group from Graphic3d
|
||||
end;
|
@@ -12,20 +12,23 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Graphic3d_ArrayOfPrimitives.ixx>
|
||||
#include <Standard.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <OSD_Environment.hxx>
|
||||
|
||||
#include <gp_Dir.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Pnt2d.hxx>
|
||||
#include <Graphic3d_ArrayOfPrimitives.hxx>
|
||||
#include <Graphic3d_Group.hxx>
|
||||
#include <Graphic3d_InitialisationError.hxx>
|
||||
#include <NCollection_AlignedAllocator.hxx>
|
||||
#include <OSD_Environment.hxx>
|
||||
#include <Quantity_Color.hxx>
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Graphic3d_ArrayOfPrimitives::Graphic3d_ArrayOfPrimitives (const Graphic3d_TypeOfPrimitiveArray theType,
|
||||
const Standard_Integer theMaxVertexs,
|
||||
const Standard_Integer theMaxBounds,
|
||||
|
379
src/Graphic3d/Graphic3d_ArrayOfPrimitives.hxx
Normal file
379
src/Graphic3d/Graphic3d_ArrayOfPrimitives.hxx
Normal file
@@ -0,0 +1,379 @@
|
||||
// Created on: 2000-06-16
|
||||
// Copyright (c) 2000-2014 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 License 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_ArrayOfPrimitives_HeaderFile
|
||||
#define _Graphic3d_ArrayOfPrimitives_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Graphic3d_IndexBuffer.hxx>
|
||||
#include <Graphic3d_Buffer.hxx>
|
||||
#include <Graphic3d_BoundBuffer.hxx>
|
||||
#include <Graphic3d_TypeOfPrimitiveArray.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Byte.hxx>
|
||||
#include <MMgt_TShared.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Standard_ShortReal.hxx>
|
||||
#include <Standard_CString.hxx>
|
||||
class Standard_OutOfRange;
|
||||
class Graphic3d_InitialisationError;
|
||||
class Graphic3d_Group;
|
||||
class gp_Pnt;
|
||||
class Quantity_Color;
|
||||
class gp_Dir;
|
||||
class gp_Pnt2d;
|
||||
|
||||
|
||||
class Graphic3d_ArrayOfPrimitives;
|
||||
DEFINE_STANDARD_HANDLE(Graphic3d_ArrayOfPrimitives, MMgt_TShared)
|
||||
|
||||
//! This class furnish services to defined and fill an
|
||||
//! array of primitives compatible with the use of
|
||||
//! the OPENGl glDrawArrays() or glDrawElements() functions.
|
||||
//! NOTE that the main goal of this kind of primitive
|
||||
//! is to avoid multiple copies of datas between
|
||||
//! each layer of the software.
|
||||
//! So the array datas exist only one time and the use
|
||||
//! of SetXxxxxx() methods enable to change dynamically
|
||||
//! the aspect of this primitive.
|
||||
//!
|
||||
//! Advantages are :
|
||||
//! 1) Decrease strongly the loading time.
|
||||
//! 2) Decrease strongly the display time using optimized Opengl
|
||||
//! primitives.
|
||||
//! 3) Enable to change dynamically the components of the primitive
|
||||
//! (vertice,normal,color,texture coordinates).
|
||||
//! 4) Add true triangle and quadrangle strips or fans capabilities.
|
||||
class Graphic3d_ArrayOfPrimitives : public MMgt_TShared
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
Standard_EXPORT void Destroy();
|
||||
~Graphic3d_ArrayOfPrimitives()
|
||||
{
|
||||
Destroy();
|
||||
}
|
||||
|
||||
//! Adds a vertice in the array.
|
||||
//! returns the actual vertex number.
|
||||
Standard_Integer AddVertex (const gp_Pnt& aVertice);
|
||||
Standard_Integer AddVertex (const Graphic3d_Vec3& theVertex);
|
||||
|
||||
//! Adds a vertice in the array.
|
||||
//! returns the actual vertex number.
|
||||
Standard_Integer AddVertex (const Standard_Real X, const Standard_Real Y, const Standard_Real Z);
|
||||
|
||||
//! Adds a vertice in the array.
|
||||
//! returns the actual vertex number.
|
||||
Standard_EXPORT Standard_Integer AddVertex (const Standard_ShortReal X, const Standard_ShortReal Y, const Standard_ShortReal Z);
|
||||
|
||||
//! Adds a vertice and vertex color in the vertex array.
|
||||
//! returns the actual vertex number.
|
||||
//! Warning: <aColor> is ignored when the <hasVColors>
|
||||
//! constructor parameter is FALSE
|
||||
Standard_EXPORT Standard_Integer AddVertex (const gp_Pnt& aVertice, const Quantity_Color& aColor);
|
||||
|
||||
//! Adds a vertice and vertex color in the vertex array.
|
||||
//! returns the actual vertex number.
|
||||
//! Warning: <aColor> is ignored when the <hasVColors>
|
||||
//! constructor parameter is FALSE
|
||||
//! aColor = Alpha << 24 + Blue << 16 + Green << 8 + Red
|
||||
//! On all architecture proccers type (x86 or SPARC) you can
|
||||
//! use this byte order.
|
||||
Standard_EXPORT Standard_Integer AddVertex (const gp_Pnt& aVertice, const Standard_Integer aColor);
|
||||
|
||||
//! Adds a vertice and vertex normal in the vertex array.
|
||||
//! returns the actual vertex number.
|
||||
//! Warning: <aNormal> is ignored when the <hasVNormals>
|
||||
//! constructor parameter is FALSE.
|
||||
Standard_Integer AddVertex (const gp_Pnt& aVertice, const gp_Dir& aNormal);
|
||||
|
||||
//! Adds a vertice and vertex normal in the vertex array.
|
||||
//! returns the actual vertex number.
|
||||
//! Warning: <aNormal> is ignored when the <hasVNormals>
|
||||
//! constructor parameter is FALSE.
|
||||
Standard_Integer AddVertex (const Standard_Real X, const Standard_Real Y, const Standard_Real Z, const Standard_Real NX, const Standard_Real NY, const Standard_Real NZ);
|
||||
|
||||
//! Adds a vertice and vertex normal in the vertex array.
|
||||
//! returns the actual vertex number.
|
||||
//! Warning: <aNormal> is ignored when the <hasVNormals>
|
||||
//! constructor parameter is FALSE.
|
||||
Standard_EXPORT Standard_Integer AddVertex (const Standard_ShortReal X, const Standard_ShortReal Y, const Standard_ShortReal Z, const Standard_ShortReal NX, const Standard_ShortReal NY, const Standard_ShortReal NZ);
|
||||
|
||||
//! Adds a vertice,vertex normal and color in the vertex array.
|
||||
//! returns the actual vertex number.
|
||||
//! Warning: <aNormal> is ignored when the <hasVNormals>
|
||||
//! constructor parameter is FALSE.
|
||||
//! <aColor> is ignored when the <hasVColors>
|
||||
//! constructor parameter is FALSE
|
||||
Standard_EXPORT Standard_Integer AddVertex (const gp_Pnt& aVertice, const gp_Dir& aNormal, const Quantity_Color& aColor);
|
||||
|
||||
//! Adds a vertice,vertex normal and color in the vertex array.
|
||||
//! returns the actual vertex number.
|
||||
//! Warning: <aNormal> is ignored when the <hasVNormals>
|
||||
//! constructor parameter is FALSE.
|
||||
//! <aColor> is ignored when the <hasVColors>
|
||||
//! constructor parameter is FALSE
|
||||
//! aColor = Alpha << 24 + Blue << 16 + Green << 8 + Red
|
||||
//! On all architecture proccers type (x86 or SPARC) you can
|
||||
//! use this byte order.
|
||||
Standard_EXPORT Standard_Integer AddVertex (const gp_Pnt& aVertice, const gp_Dir& aNormal, const Standard_Integer aColor);
|
||||
|
||||
//! Adds a vertice and vertex texture in the vertex array.
|
||||
//! returns the actual vertex number.
|
||||
//! <aTexel> is ignored when the <hasVTexels>
|
||||
//! constructor parameter is FALSE.
|
||||
Standard_Integer AddVertex (const gp_Pnt& aVertice, const gp_Pnt2d& aTexel);
|
||||
|
||||
//! Adds a vertice and vertex texture coordinates in the vertex array.
|
||||
//! returns the actual vertex number.
|
||||
//! <aTexel> is ignored when the <hasVTexels>
|
||||
//! constructor parameter is FALSE.
|
||||
Standard_Integer AddVertex (const Standard_Real X, const Standard_Real Y, const Standard_Real Z, const Standard_Real TX, const Standard_Real TY);
|
||||
|
||||
//! Adds a vertice and vertex texture coordinates in the vertex array.
|
||||
//! returns the actual vertex number.
|
||||
//! <aTexel> is ignored when the <hasVTexels>
|
||||
//! constructor parameter is FALSE.
|
||||
Standard_EXPORT Standard_Integer AddVertex (const Standard_ShortReal X, const Standard_ShortReal Y, const Standard_ShortReal Z, const Standard_ShortReal TX, const Standard_ShortReal TY);
|
||||
|
||||
//! Adds a vertice,vertex normal and texture in the vertex array.
|
||||
//! returns the actual vertex number.
|
||||
//! Warning: <aNormal> is ignored when the <hasVNormals>
|
||||
//! constructor parameter is FALSE.
|
||||
//! <aTexel> is ignored when the <hasVTexels>
|
||||
//! constructor parameter is FALSE.
|
||||
Standard_Integer AddVertex (const gp_Pnt& aVertice, const gp_Dir& aNormal, const gp_Pnt2d& aTexel);
|
||||
|
||||
//! Adds a vertice,vertex normal and texture in the vertex array.
|
||||
//! returns the actual vertex number.
|
||||
//! Warning: <aNormal> is ignored when the <hasVNormals>
|
||||
//! constructor parameter is FALSE.
|
||||
//! <aTexel> is ignored when the <hasVTexels>
|
||||
//! constructor parameter is FALSE.
|
||||
Standard_Integer AddVertex (const Standard_Real X, const Standard_Real Y, const Standard_Real Z, const Standard_Real NX, const Standard_Real NY, const Standard_Real NZ, const Standard_Real TX, const Standard_Real TY);
|
||||
|
||||
//! Adds a vertice,vertex normal and texture in the vertex array.
|
||||
//! returns the actual vertex number.
|
||||
//! Warning: <aNormal> is ignored when the <hasVNormals>
|
||||
//! constructor parameter is FALSE.
|
||||
//! <aTexel> is ignored when the <hasVTexels>
|
||||
//! constructor parameter is FALSE.
|
||||
Standard_EXPORT Standard_Integer AddVertex (const Standard_ShortReal X, const Standard_ShortReal Y, const Standard_ShortReal Z, const Standard_ShortReal NX, const Standard_ShortReal NY, const Standard_ShortReal NZ, const Standard_ShortReal TX, const Standard_ShortReal TY);
|
||||
|
||||
//! Adds a bound of length <edgeNumber> in the bound array
|
||||
//! returns the actual bounds number.
|
||||
Standard_EXPORT Standard_Integer AddBound (const Standard_Integer edgeNumber);
|
||||
|
||||
//! Adds a bound of length <edgeNumber> and bound color
|
||||
//! <aBColor> in the bound array.
|
||||
//! returns the actual bounds number.
|
||||
//! Warning: <aBColor> is ignored when the <hasBColors>
|
||||
//! constructor parameter is FALSE
|
||||
Standard_EXPORT Standard_Integer AddBound (const Standard_Integer edgeNumber, const Quantity_Color& aBColor);
|
||||
|
||||
//! Adds a bound of length <edgeNumber> and bound color
|
||||
//! coordinates in the bound array.
|
||||
//! returns the actual bounds number.
|
||||
//! Warning: <R,G,B> are ignored when the <hasBColors>
|
||||
//! constructor parameter is FALSE
|
||||
Standard_EXPORT Standard_Integer AddBound (const Standard_Integer edgeNumber, const Standard_Real R, const Standard_Real G, const Standard_Real B);
|
||||
|
||||
//! Adds an edge in the range [1,VertexNumber()] in the array.
|
||||
//! Returns the actual edges number.
|
||||
Standard_EXPORT Standard_Integer AddEdge (const Standard_Integer vertexIndex);
|
||||
|
||||
//! Change the vertice of rank <anIndex> in the array.
|
||||
Standard_EXPORT void SetVertice (const Standard_Integer anIndex, const gp_Pnt& aVertice);
|
||||
|
||||
//! Change the vertice of rank <anIndex> in the array.
|
||||
void SetVertice (const Standard_Integer anIndex, const Standard_ShortReal X, const Standard_ShortReal Y, const Standard_ShortReal Z);
|
||||
|
||||
//! Change the vertex color of rank <anIndex> in the array.
|
||||
Standard_EXPORT void SetVertexColor (const Standard_Integer anIndex, const Quantity_Color& aColor);
|
||||
|
||||
//! Change the vertex color of rank <anIndex> in the array.
|
||||
void SetVertexColor (const Standard_Integer anIndex, const Standard_Real R, const Standard_Real G, const Standard_Real B);
|
||||
|
||||
//! Change the vertex color of rank <anIndex> in the array.
|
||||
//! aColor = Alpha << 24 + Blue << 16 + Green << 8 + Red
|
||||
//! On all architecture proccers type (x86 or SPARC) you can
|
||||
//! use this byte order.
|
||||
Standard_EXPORT void SetVertexColor (const Standard_Integer anIndex, const Standard_Integer aColor);
|
||||
|
||||
//! Change the vertex normal of rank <anIndex> in the array.
|
||||
Standard_EXPORT void SetVertexNormal (const Standard_Integer anIndex, const gp_Dir& aNormal);
|
||||
|
||||
//! Change the vertex normal of rank <anIndex> in the array.
|
||||
void SetVertexNormal (const Standard_Integer anIndex, const Standard_Real NX, const Standard_Real NY, const Standard_Real NZ);
|
||||
|
||||
//! Change the vertex texel of rank <anIndex> in the array.
|
||||
Standard_EXPORT void SetVertexTexel (const Standard_Integer anIndex, const gp_Pnt2d& aTexel);
|
||||
|
||||
//! Change the vertex texel of rank <anIndex> in the array.
|
||||
void SetVertexTexel (const Standard_Integer anIndex, const Standard_Real TX, const Standard_Real TY);
|
||||
|
||||
//! Change the bound color of rank <anIndex> in the array.
|
||||
Standard_EXPORT void SetBoundColor (const Standard_Integer anIndex, const Quantity_Color& aColor);
|
||||
|
||||
//! Change the bound color of rank <anIndex> in the array.
|
||||
void SetBoundColor (const Standard_Integer anIndex, const Standard_Real R, const Standard_Real G, const Standard_Real B);
|
||||
|
||||
//! Returns optional index buffer.
|
||||
const Handle(Graphic3d_IndexBuffer)& Indices() const;
|
||||
|
||||
//! Returns vertex attributes buffer (colors, normals, texture coordinates).
|
||||
const Handle(Graphic3d_Buffer)& Attributes() const;
|
||||
|
||||
//! Returns optional bounds buffer.
|
||||
const Handle(Graphic3d_BoundBuffer)& Bounds() const;
|
||||
|
||||
//! Returns the type of this primitive
|
||||
Graphic3d_TypeOfPrimitiveArray Type() const;
|
||||
|
||||
//! Returns the string type of this primitive
|
||||
Standard_EXPORT Standard_CString StringType() const;
|
||||
|
||||
//! Returns TRUE when vertex normals array is defined.
|
||||
Standard_Boolean HasVertexNormals() const;
|
||||
|
||||
//! Returns TRUE when vertex colors array is defined.
|
||||
Standard_Boolean HasVertexColors() const;
|
||||
|
||||
//! Returns TRUE when vertex texels array is defined.
|
||||
Standard_Boolean HasVertexTexels() const;
|
||||
|
||||
//! Returns the number of defined vertex
|
||||
Standard_Integer VertexNumber() const;
|
||||
|
||||
//! Returns the vertice at rank <aRank>
|
||||
//! from the vertex table if defined.
|
||||
Standard_EXPORT gp_Pnt Vertice (const Standard_Integer aRank) const;
|
||||
|
||||
//! Returns the vertice coordinates at rank <aRank>
|
||||
//! from the vertex table if defined.
|
||||
void Vertice (const Standard_Integer aRank, Standard_Real& X, Standard_Real& Y, Standard_Real& Z) const;
|
||||
|
||||
//! Returns the vertex color at rank <aRank>
|
||||
//! from the vertex table if defined.
|
||||
Standard_EXPORT Quantity_Color VertexColor (const Standard_Integer aRank) const;
|
||||
|
||||
//! Returns the vertex color values at rank <aRank>
|
||||
//! from the vertex table if defined.
|
||||
void VertexColor (const Standard_Integer aRank, Standard_Real& R, Standard_Real& G, Standard_Real& B) const;
|
||||
|
||||
//! Returns the vertex color values at rank <aRank>
|
||||
//! from the vertex table if defined.
|
||||
void VertexColor (const Standard_Integer aRank, Standard_Integer& aColor) const;
|
||||
|
||||
//! Returns the vertex normal at rank <aRank>
|
||||
//! from the vertex table if defined.
|
||||
Standard_EXPORT gp_Dir VertexNormal (const Standard_Integer aRank) const;
|
||||
|
||||
//! Returns the vertex normal coordinates at rank <aRank>
|
||||
//! from the vertex table if defined.
|
||||
void VertexNormal (const Standard_Integer aRank, Standard_Real& NX, Standard_Real& NY, Standard_Real& NZ) const;
|
||||
|
||||
//! Returns the vertex texture at rank <aRank>
|
||||
//! from the vertex table if defined.
|
||||
Standard_EXPORT gp_Pnt2d VertexTexel (const Standard_Integer aRank) const;
|
||||
|
||||
//! Returns the vertex texture coordinates at rank <aRank>
|
||||
//! from the vertex table if defined.
|
||||
void VertexTexel (const Standard_Integer aRank, Standard_Real& TX, Standard_Real& TY) const;
|
||||
|
||||
//! Returns the number of defined edges
|
||||
Standard_Integer EdgeNumber() const;
|
||||
|
||||
//! Returns the vertex index at rank <aRank>
|
||||
//! in the range [1,VertexNumber()]
|
||||
Standard_Integer Edge (const Standard_Integer aRank) const;
|
||||
|
||||
//! Returns TRUE when bound colors array is defined.
|
||||
Standard_Boolean HasBoundColors() const;
|
||||
|
||||
//! Returns the number of defined bounds
|
||||
Standard_Integer BoundNumber() const;
|
||||
|
||||
//! Returns the edge number at rank <aRank>.
|
||||
Standard_Integer Bound (const Standard_Integer aRank) const;
|
||||
|
||||
//! Returns the bound color at rank <aRank>
|
||||
//! from the bound table if defined.
|
||||
Standard_EXPORT Quantity_Color BoundColor (const Standard_Integer aRank) const;
|
||||
|
||||
//! Returns the bound color values at rank <aRank>
|
||||
//! from the bound table if defined.
|
||||
Standard_EXPORT void BoundColor (const Standard_Integer aRank, Standard_Real& R, Standard_Real& G, Standard_Real& B) const;
|
||||
|
||||
//! Returns the number of total items according to
|
||||
//! the array type.
|
||||
Standard_EXPORT Standard_Integer ItemNumber() const;
|
||||
|
||||
//! Returns TRUE only when the contains of this array is
|
||||
//! available.
|
||||
Standard_EXPORT Standard_Boolean IsValid();
|
||||
|
||||
friend class Graphic3d_Group;
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Graphic3d_ArrayOfPrimitives,MMgt_TShared)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
//! Warning
|
||||
//! You must use a coherent set of AddVertex() methods according to the
|
||||
//! <hasVNormals>,<hasVColors>,<hasVTexels>,<hasBColors>
|
||||
//! User is responsible of confuse vertex and bad normal orientation.
|
||||
//! You must use AddBound() method only if the <maxBounds>
|
||||
//! constructor parameter is > 0.
|
||||
//! You must use AddEdge() method only if the <maxEdges>
|
||||
//! constructor parameter is > 0.
|
||||
Standard_EXPORT Graphic3d_ArrayOfPrimitives(const Graphic3d_TypeOfPrimitiveArray aType, const Standard_Integer maxVertexs, const Standard_Integer maxBounds, const Standard_Integer maxEdges, const Standard_Boolean hasVNormals, const Standard_Boolean hasVColors, const Standard_Boolean hasBColors, const Standard_Boolean hasTexels);
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT void ComputeVNormals (const Standard_Integer fromIndex, const Standard_Integer toIndex);
|
||||
|
||||
Handle(Graphic3d_IndexBuffer) myIndices;
|
||||
Handle(Graphic3d_Buffer) myAttribs;
|
||||
Handle(Graphic3d_BoundBuffer) myBounds;
|
||||
Graphic3d_TypeOfPrimitiveArray myType;
|
||||
Standard_Integer myMaxBounds;
|
||||
Standard_Integer myMaxVertexs;
|
||||
Standard_Integer myMaxEdges;
|
||||
Standard_Byte myVNor;
|
||||
Standard_Byte myVTex;
|
||||
Standard_Byte myVCol;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <Graphic3d_ArrayOfPrimitives.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Graphic3d_ArrayOfPrimitives_HeaderFile
|
@@ -1,74 +0,0 @@
|
||||
-- Created on: 2001-01-04
|
||||
-- Copyright (c) 2001-2014 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 License 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.
|
||||
|
||||
class ArrayOfQuadrangleStrips from Graphic3d inherits ArrayOfPrimitives from Graphic3d
|
||||
---Purpose: Contains quadrangles strip array definition
|
||||
|
||||
is
|
||||
|
||||
-- constructor
|
||||
Create (
|
||||
maxVertexs: Integer from Standard;
|
||||
maxStrips: Integer from Standard = 0;
|
||||
hasVNormals: Boolean from Standard = Standard_False;
|
||||
hasVColors: Boolean from Standard = Standard_False;
|
||||
hasSColors: Boolean from Standard = Standard_False;
|
||||
hasTexels: Boolean from Standard = Standard_False)
|
||||
returns ArrayOfQuadrangleStrips from Graphic3d;
|
||||
---Purpose: Creates an array of quadrangle strips,
|
||||
-- a polygon can be filled as:
|
||||
-- 1) creating a single strip defined with his vertexs.
|
||||
-- i.e:
|
||||
-- myArray = Graphic3d_ArrayOfQuadrangleStrips(7)
|
||||
-- myArray->AddVertex(x1,y1,z1)
|
||||
-- ....
|
||||
-- myArray->AddVertex(x7,y7,z7)
|
||||
-- 2) creating separate strips defined with a predefined
|
||||
-- number of strips and the number of vertex per strip.
|
||||
-- i.e:
|
||||
-- myArray = Graphic3d_ArrayOfQuadrangleStrips(8,2)
|
||||
-- myArray->AddBound(4)
|
||||
-- myArray->AddVertex(x1,y1,z1)
|
||||
-- ....
|
||||
-- myArray->AddVertex(x4,y4,z4)
|
||||
-- myArray->AddBound(4)
|
||||
-- myArray->AddVertex(x5,y5,z5)
|
||||
-- ....
|
||||
-- myArray->AddVertex(x8,y8,z8)
|
||||
--
|
||||
-- <maxVertexs> defined the maximun allowed vertex number in the array.
|
||||
-- <maxStrips> defined the maximun allowed strip number in the array.
|
||||
-- The number of quadrangle really drawn is :
|
||||
-- VertexNumber()/2-Min(1,BoundNumber())
|
||||
---Warning:
|
||||
-- When <hasVNormals> is TRUE , you must use one of
|
||||
-- AddVertex(Point,Normal)
|
||||
-- or AddVertex(Point,Normal,Color)
|
||||
-- or AddVertex(Point,Normal,Texel) methods.
|
||||
-- When <hasVColors> is TRUE , you must use one of
|
||||
-- AddVertex(Point,Color)
|
||||
-- or AddVertex(Point,Normal,Color) methods.
|
||||
-- When <hasTexels> is TRUE , you must use one of
|
||||
-- AddVertex(Point,Texel)
|
||||
-- or AddVertex(Point,Normal,Texel) methods.
|
||||
-- When <hasBColors> is TRUE , <maxBounds> must be > 0 and
|
||||
-- you must use the
|
||||
-- AddBound(number,Color) method.
|
||||
-- Warning:
|
||||
-- the user is responsible about the orientation of the strip
|
||||
-- depending of the order of the created vertex and this
|
||||
-- orientation must be coherent with the vertex normal optionnaly
|
||||
-- given at each vertex (See the Orientate() methods).
|
||||
|
||||
end;
|
@@ -12,7 +12,9 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Graphic3d_ArrayOfQuadrangleStrips.ixx>
|
||||
|
||||
#include <Graphic3d_ArrayOfQuadrangleStrips.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
Graphic3d_ArrayOfQuadrangleStrips::Graphic3d_ArrayOfQuadrangleStrips (const Standard_Integer theMaxVertexs,
|
||||
const Standard_Integer theMaxStrips,
|
||||
|
86
src/Graphic3d/Graphic3d_ArrayOfQuadrangleStrips.hxx
Normal file
86
src/Graphic3d/Graphic3d_ArrayOfQuadrangleStrips.hxx
Normal file
@@ -0,0 +1,86 @@
|
||||
// Created on: 2001-01-04
|
||||
// Copyright (c) 2001-2014 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 License 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_ArrayOfQuadrangleStrips_HeaderFile
|
||||
#define _Graphic3d_ArrayOfQuadrangleStrips_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Graphic3d_ArrayOfPrimitives.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
|
||||
|
||||
class Graphic3d_ArrayOfQuadrangleStrips;
|
||||
DEFINE_STANDARD_HANDLE(Graphic3d_ArrayOfQuadrangleStrips, Graphic3d_ArrayOfPrimitives)
|
||||
|
||||
//! Contains quadrangles strip array definition
|
||||
class Graphic3d_ArrayOfQuadrangleStrips : public Graphic3d_ArrayOfPrimitives
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates an array of quadrangle strips,
|
||||
//! a polygon can be filled as:
|
||||
//! 1) creating a single strip defined with his vertexs.
|
||||
//! i.e:
|
||||
//! myArray = Graphic3d_ArrayOfQuadrangleStrips(7)
|
||||
//! myArray->AddVertex(x1,y1,z1)
|
||||
//! ....
|
||||
//! myArray->AddVertex(x7,y7,z7)
|
||||
//! 2) creating separate strips defined with a predefined
|
||||
//! number of strips and the number of vertex per strip.
|
||||
//! i.e:
|
||||
//! myArray = Graphic3d_ArrayOfQuadrangleStrips(8,2)
|
||||
//! myArray->AddBound(4)
|
||||
//! myArray->AddVertex(x1,y1,z1)
|
||||
//! ....
|
||||
//! myArray->AddVertex(x4,y4,z4)
|
||||
//! myArray->AddBound(4)
|
||||
//! myArray->AddVertex(x5,y5,z5)
|
||||
//! ....
|
||||
//! myArray->AddVertex(x8,y8,z8)
|
||||
//!
|
||||
//! <maxVertexs> defined the maximun allowed vertex number in the array.
|
||||
//! <maxStrips> defined the maximun allowed strip number in the array.
|
||||
//! The number of quadrangle really drawn is :
|
||||
//! VertexNumber()/2-Min(1,BoundNumber())
|
||||
Standard_EXPORT Graphic3d_ArrayOfQuadrangleStrips(const Standard_Integer maxVertexs, const Standard_Integer maxStrips = 0, const Standard_Boolean hasVNormals = Standard_False, const Standard_Boolean hasVColors = Standard_False, const Standard_Boolean hasSColors = Standard_False, const Standard_Boolean hasTexels = Standard_False);
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Graphic3d_ArrayOfQuadrangleStrips,Graphic3d_ArrayOfPrimitives)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Graphic3d_ArrayOfQuadrangleStrips_HeaderFile
|
@@ -1,80 +0,0 @@
|
||||
-- Created on: 2001-01-04
|
||||
-- Copyright (c) 2001-2014 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 License 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.
|
||||
|
||||
class ArrayOfQuadrangles from Graphic3d inherits ArrayOfPrimitives from Graphic3d
|
||||
---Purpose: Contains quatrangles array definition
|
||||
|
||||
uses
|
||||
Color from Quantity,
|
||||
Pnt from gp,
|
||||
Pnt2d from gp,
|
||||
Dir from gp
|
||||
|
||||
raises
|
||||
OutOfRange from Standard
|
||||
|
||||
is
|
||||
|
||||
-- constructor
|
||||
Create (
|
||||
maxVertexs: Integer from Standard;
|
||||
maxEdges: Integer from Standard = 0;
|
||||
hasVNormals: Boolean from Standard = Standard_False;
|
||||
hasVColors: Boolean from Standard = Standard_False;
|
||||
hasTexels: Boolean from Standard = Standard_False)
|
||||
returns ArrayOfQuadrangles from Graphic3d;
|
||||
---Purpose: Creates an array of quadrangles,
|
||||
-- a quadrangle can be filled as:
|
||||
-- 1) creating a set of quadrangles defined with his vertexs.
|
||||
-- i.e:
|
||||
-- myArray = Graphic3d_ArrayOfQuadrangles(8)
|
||||
-- myArray->AddVertex(x1,y1,z1)
|
||||
-- ....
|
||||
-- myArray->AddVertex(x8,y8,z8)
|
||||
-- 3) creating a set of indexed quadrangles defined with his vertex
|
||||
-- ans edges.
|
||||
-- i.e:
|
||||
-- myArray = Graphic3d_ArrayOfQuadrangles(6,8)
|
||||
-- myArray->AddVertex(x1,y1,z1)
|
||||
-- ....
|
||||
-- myArray->AddVertex(x6,y6,z6)
|
||||
-- myArray->AddEdge(1)
|
||||
-- myArray->AddEdge(2)
|
||||
-- myArray->AddEdge(3)
|
||||
-- myArray->AddEdge(4)
|
||||
-- myArray->AddEdge(3)
|
||||
-- myArray->AddEdge(4)
|
||||
-- myArray->AddEdge(5)
|
||||
-- myArray->AddEdge(6)
|
||||
--
|
||||
-- <maxVertexs> defined the maximun allowed vertex number in the array.
|
||||
-- <maxEdges> defined the maximun allowed edge number in the array.
|
||||
-- Warning:
|
||||
-- When <hasVNormals> is TRUE , you must use one of
|
||||
-- AddVertex(Point,Normal)
|
||||
-- or AddVertex(Point,Normal,Color)
|
||||
-- or AddVertex(Point,Normal,Texel) methods.
|
||||
-- When <hasVColors> is TRUE , you must use one of
|
||||
-- AddVertex(Point,Color)
|
||||
-- or AddVertex(Point,Normal,Color) methods.
|
||||
-- When <hasTexels> is TRUE , you must use one of
|
||||
-- AddVertex(Point,Texel)
|
||||
-- or AddVertex(Point,Normal,Texel) methods.
|
||||
-- Warning:
|
||||
-- the user is responsible about the orientation of the quadrangle
|
||||
-- depending of the order of the created vertex or edges and this
|
||||
-- orientation must be coherent with the vertex normal optionnaly
|
||||
-- given at each vertex (See the Orientate() methods).
|
||||
|
||||
end;
|
@@ -12,7 +12,10 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Graphic3d_ArrayOfQuadrangles.ixx>
|
||||
|
||||
#include <Graphic3d_ArrayOfQuadrangles.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
Graphic3d_ArrayOfQuadrangles::Graphic3d_ArrayOfQuadrangles (const Standard_Integer theMaxVertexs,
|
||||
const Standard_Integer theMaxEdges,
|
||||
|
104
src/Graphic3d/Graphic3d_ArrayOfQuadrangles.hxx
Normal file
104
src/Graphic3d/Graphic3d_ArrayOfQuadrangles.hxx
Normal file
@@ -0,0 +1,104 @@
|
||||
// Created on: 2001-01-04
|
||||
// Copyright (c) 2001-2014 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 License 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_ArrayOfQuadrangles_HeaderFile
|
||||
#define _Graphic3d_ArrayOfQuadrangles_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Graphic3d_ArrayOfPrimitives.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class Standard_OutOfRange;
|
||||
|
||||
|
||||
class Graphic3d_ArrayOfQuadrangles;
|
||||
DEFINE_STANDARD_HANDLE(Graphic3d_ArrayOfQuadrangles, Graphic3d_ArrayOfPrimitives)
|
||||
|
||||
//! Contains quatrangles array definition
|
||||
class Graphic3d_ArrayOfQuadrangles : public Graphic3d_ArrayOfPrimitives
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates an array of quadrangles,
|
||||
//! a quadrangle can be filled as:
|
||||
//! 1) creating a set of quadrangles defined with his vertexs.
|
||||
//! i.e:
|
||||
//! myArray = Graphic3d_ArrayOfQuadrangles(8)
|
||||
//! myArray->AddVertex(x1,y1,z1)
|
||||
//! ....
|
||||
//! myArray->AddVertex(x8,y8,z8)
|
||||
//! 3) creating a set of indexed quadrangles defined with his vertex
|
||||
//! ans edges.
|
||||
//! i.e:
|
||||
//! myArray = Graphic3d_ArrayOfQuadrangles(6,8)
|
||||
//! myArray->AddVertex(x1,y1,z1)
|
||||
//! ....
|
||||
//! myArray->AddVertex(x6,y6,z6)
|
||||
//! myArray->AddEdge(1)
|
||||
//! myArray->AddEdge(2)
|
||||
//! myArray->AddEdge(3)
|
||||
//! myArray->AddEdge(4)
|
||||
//! myArray->AddEdge(3)
|
||||
//! myArray->AddEdge(4)
|
||||
//! myArray->AddEdge(5)
|
||||
//! myArray->AddEdge(6)
|
||||
//!
|
||||
//! <maxVertexs> defined the maximun allowed vertex number in the array.
|
||||
//! <maxEdges> defined the maximun allowed edge number in the array.
|
||||
//! Warning:
|
||||
//! When <hasVNormals> is TRUE , you must use one of
|
||||
//! AddVertex(Point,Normal)
|
||||
//! or AddVertex(Point,Normal,Color)
|
||||
//! or AddVertex(Point,Normal,Texel) methods.
|
||||
//! When <hasVColors> is TRUE , you must use one of
|
||||
//! AddVertex(Point,Color)
|
||||
//! or AddVertex(Point,Normal,Color) methods.
|
||||
//! When <hasTexels> is TRUE , you must use one of
|
||||
//! AddVertex(Point,Texel)
|
||||
//! or AddVertex(Point,Normal,Texel) methods.
|
||||
//! Warning:
|
||||
//! the user is responsible about the orientation of the quadrangle
|
||||
//! depending of the order of the created vertex or edges and this
|
||||
//! orientation must be coherent with the vertex normal optionnaly
|
||||
//! given at each vertex (See the Orientate() methods).
|
||||
Standard_EXPORT Graphic3d_ArrayOfQuadrangles(const Standard_Integer maxVertexs, const Standard_Integer maxEdges = 0, const Standard_Boolean hasVNormals = Standard_False, const Standard_Boolean hasVColors = Standard_False, const Standard_Boolean hasTexels = Standard_False);
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Graphic3d_ArrayOfQuadrangles,Graphic3d_ArrayOfPrimitives)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Graphic3d_ArrayOfQuadrangles_HeaderFile
|
@@ -1,56 +0,0 @@
|
||||
-- Created on: 2001-01-04
|
||||
-- Copyright (c) 2001-2014 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 License 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.
|
||||
|
||||
class ArrayOfSegments from Graphic3d inherits ArrayOfPrimitives from Graphic3d
|
||||
---Purpose: Contains segments array definition
|
||||
|
||||
is
|
||||
|
||||
-- constructor
|
||||
Create (
|
||||
maxVertexs: Integer from Standard;
|
||||
maxEdges: Integer from Standard = 0;
|
||||
hasVColors: Boolean from Standard = Standard_False)
|
||||
returns ArrayOfSegments from Graphic3d;
|
||||
---Purpose: Creates an array of segments,
|
||||
-- a segment can be filled as:
|
||||
-- 1) creating a set of segments defined with his vertexs.
|
||||
-- i.e:
|
||||
-- myArray = Graphic3d_ArrayOfSegments(4)
|
||||
-- myArray->AddVertex(x1,y1,z1)
|
||||
-- ....
|
||||
-- myArray->AddVertex(x4,y4,z4)
|
||||
-- 2) creating a set of indexed segments defined with his vertex
|
||||
-- ans edges.
|
||||
-- i.e:
|
||||
-- myArray = Graphic3d_ArrayOfSegments(4,0,8)
|
||||
-- myArray->AddVertex(x1,y1,z1)
|
||||
-- ....
|
||||
-- myArray->AddVertex(x4,y4,z4)
|
||||
-- myArray->AddEdge(1)
|
||||
-- myArray->AddEdge(2)
|
||||
-- myArray->AddEdge(3)
|
||||
-- myArray->AddEdge(4)
|
||||
-- myArray->AddEdge(2)
|
||||
-- myArray->AddEdge(4)
|
||||
-- myArray->AddEdge(1)
|
||||
-- myArray->AddEdge(3)
|
||||
--
|
||||
-- <maxVertexs> defined the maximun allowed vertex number in the array.
|
||||
-- <maxEdges> defined the maximun allowed edge number in the array.
|
||||
-- Warning:
|
||||
-- When <hasVColors> is TRUE , you must use only
|
||||
-- AddVertex(Point,Color) method
|
||||
|
||||
end;
|
@@ -12,7 +12,9 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Graphic3d_ArrayOfSegments.ixx>
|
||||
|
||||
#include <Graphic3d_ArrayOfSegments.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
Graphic3d_ArrayOfSegments::Graphic3d_ArrayOfSegments (const Standard_Integer theMaxVertexs,
|
||||
const Standard_Integer theMaxEdges,
|
||||
|
90
src/Graphic3d/Graphic3d_ArrayOfSegments.hxx
Normal file
90
src/Graphic3d/Graphic3d_ArrayOfSegments.hxx
Normal file
@@ -0,0 +1,90 @@
|
||||
// Created on: 2001-01-04
|
||||
// Copyright (c) 2001-2014 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 License 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_ArrayOfSegments_HeaderFile
|
||||
#define _Graphic3d_ArrayOfSegments_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Graphic3d_ArrayOfPrimitives.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
|
||||
|
||||
class Graphic3d_ArrayOfSegments;
|
||||
DEFINE_STANDARD_HANDLE(Graphic3d_ArrayOfSegments, Graphic3d_ArrayOfPrimitives)
|
||||
|
||||
//! Contains segments array definition
|
||||
class Graphic3d_ArrayOfSegments : public Graphic3d_ArrayOfPrimitives
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates an array of segments,
|
||||
//! a segment can be filled as:
|
||||
//! 1) creating a set of segments defined with his vertexs.
|
||||
//! i.e:
|
||||
//! myArray = Graphic3d_ArrayOfSegments(4)
|
||||
//! myArray->AddVertex(x1,y1,z1)
|
||||
//! ....
|
||||
//! myArray->AddVertex(x4,y4,z4)
|
||||
//! 2) creating a set of indexed segments defined with his vertex
|
||||
//! ans edges.
|
||||
//! i.e:
|
||||
//! myArray = Graphic3d_ArrayOfSegments(4,0,8)
|
||||
//! myArray->AddVertex(x1,y1,z1)
|
||||
//! ....
|
||||
//! myArray->AddVertex(x4,y4,z4)
|
||||
//! myArray->AddEdge(1)
|
||||
//! myArray->AddEdge(2)
|
||||
//! myArray->AddEdge(3)
|
||||
//! myArray->AddEdge(4)
|
||||
//! myArray->AddEdge(2)
|
||||
//! myArray->AddEdge(4)
|
||||
//! myArray->AddEdge(1)
|
||||
//! myArray->AddEdge(3)
|
||||
//!
|
||||
//! <maxVertexs> defined the maximun allowed vertex number in the array.
|
||||
//! <maxEdges> defined the maximun allowed edge number in the array.
|
||||
//! Warning:
|
||||
//! When <hasVColors> is TRUE , you must use only
|
||||
//! AddVertex(Point,Color) method
|
||||
Standard_EXPORT Graphic3d_ArrayOfSegments(const Standard_Integer maxVertexs, const Standard_Integer maxEdges = 0, const Standard_Boolean hasVColors = Standard_False);
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Graphic3d_ArrayOfSegments,Graphic3d_ArrayOfPrimitives)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Graphic3d_ArrayOfSegments_HeaderFile
|
@@ -1,75 +0,0 @@
|
||||
-- Created on: 2001-01-04
|
||||
-- Copyright (c) 2001-2014 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 License 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.
|
||||
|
||||
class ArrayOfTriangleFans from Graphic3d inherits ArrayOfPrimitives from Graphic3d
|
||||
---Purpose: Contains triangles fan array definition
|
||||
|
||||
is
|
||||
|
||||
-- constructor
|
||||
Create (
|
||||
maxVertexs: Integer from Standard;
|
||||
maxFans: Integer from Standard = 0;
|
||||
hasVNormals: Boolean from Standard = Standard_False;
|
||||
hasVColors: Boolean from Standard = Standard_False;
|
||||
hasFColors: Boolean from Standard = Standard_False;
|
||||
hasTexels: Boolean from Standard = Standard_False)
|
||||
returns ArrayOfTriangleFans from Graphic3d;
|
||||
---Purpose: Creates an array of triangle fans,
|
||||
-- a polygon can be filled as:
|
||||
-- 1) creating a single fan defined with his vertexs.
|
||||
-- i.e:
|
||||
-- myArray = Graphic3d_ArrayOfTriangleFans(7)
|
||||
-- myArray->AddVertex(x1,y1,z1)
|
||||
-- ....
|
||||
-- myArray->AddVertex(x7,y7,z7)
|
||||
-- 2) creating separate fans defined with a predefined
|
||||
-- number of fans and the number of vertex per fan.
|
||||
-- i.e:
|
||||
-- myArray = Graphic3d_ArrayOfTriangleFans(8,2)
|
||||
-- myArray->AddBound(4)
|
||||
-- myArray->AddVertex(x1,y1,z1)
|
||||
-- ....
|
||||
-- myArray->AddVertex(x4,y4,z4)
|
||||
-- myArray->AddBound(4)
|
||||
-- myArray->AddVertex(x5,y5,z5)
|
||||
-- ....
|
||||
-- myArray->AddVertex(x8,y8,z8)
|
||||
--
|
||||
-- <maxVertexs> defined the maximun allowed vertex number in the array.
|
||||
-- <maxFans> defined the maximun allowed fan number in the array.
|
||||
-- The number of triangle really drawn is :
|
||||
-- VertexNumber()-2*Min(1,BoundNumber())
|
||||
---Warning:
|
||||
-- When <hasVNormals> is TRUE , you must use one of
|
||||
-- AddVertex(Point,Normal)
|
||||
-- or AddVertex(Point,Normal,Color)
|
||||
-- or AddVertex(Point,Normal,Texel) methods.
|
||||
-- When <hasVColors> is TRUE , you must use one of
|
||||
-- AddVertex(Point,Color)
|
||||
-- or AddVertex(Point,Normal,Color) methods.
|
||||
-- When <hasTexels> is TRUE , you must use one of
|
||||
-- AddVertex(Point,Texel)
|
||||
-- or AddVertex(Point,Normal,Texel) methods.
|
||||
-- When <hasBColors> is TRUE , <maxBounds> must be > 0 and
|
||||
-- you must use the
|
||||
-- AddBound(number,Color) method.
|
||||
-- Warning:
|
||||
-- the user is responsible about the orientation of the fan
|
||||
-- depending of the order of the created vertex and this
|
||||
-- orientation must be coherent with the vertex normal optionnaly
|
||||
-- given at each vertex (See the Orientate() methods).
|
||||
|
||||
|
||||
end;
|
@@ -12,7 +12,9 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Graphic3d_ArrayOfTriangleFans.ixx>
|
||||
|
||||
#include <Graphic3d_ArrayOfTriangleFans.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
Graphic3d_ArrayOfTriangleFans::Graphic3d_ArrayOfTriangleFans (const Standard_Integer theMaxVertexs,
|
||||
const Standard_Integer theMaxFans,
|
||||
|
86
src/Graphic3d/Graphic3d_ArrayOfTriangleFans.hxx
Normal file
86
src/Graphic3d/Graphic3d_ArrayOfTriangleFans.hxx
Normal file
@@ -0,0 +1,86 @@
|
||||
// Created on: 2001-01-04
|
||||
// Copyright (c) 2001-2014 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 License 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_ArrayOfTriangleFans_HeaderFile
|
||||
#define _Graphic3d_ArrayOfTriangleFans_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Graphic3d_ArrayOfPrimitives.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
|
||||
|
||||
class Graphic3d_ArrayOfTriangleFans;
|
||||
DEFINE_STANDARD_HANDLE(Graphic3d_ArrayOfTriangleFans, Graphic3d_ArrayOfPrimitives)
|
||||
|
||||
//! Contains triangles fan array definition
|
||||
class Graphic3d_ArrayOfTriangleFans : public Graphic3d_ArrayOfPrimitives
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates an array of triangle fans,
|
||||
//! a polygon can be filled as:
|
||||
//! 1) creating a single fan defined with his vertexs.
|
||||
//! i.e:
|
||||
//! myArray = Graphic3d_ArrayOfTriangleFans(7)
|
||||
//! myArray->AddVertex(x1,y1,z1)
|
||||
//! ....
|
||||
//! myArray->AddVertex(x7,y7,z7)
|
||||
//! 2) creating separate fans defined with a predefined
|
||||
//! number of fans and the number of vertex per fan.
|
||||
//! i.e:
|
||||
//! myArray = Graphic3d_ArrayOfTriangleFans(8,2)
|
||||
//! myArray->AddBound(4)
|
||||
//! myArray->AddVertex(x1,y1,z1)
|
||||
//! ....
|
||||
//! myArray->AddVertex(x4,y4,z4)
|
||||
//! myArray->AddBound(4)
|
||||
//! myArray->AddVertex(x5,y5,z5)
|
||||
//! ....
|
||||
//! myArray->AddVertex(x8,y8,z8)
|
||||
//!
|
||||
//! <maxVertexs> defined the maximun allowed vertex number in the array.
|
||||
//! <maxFans> defined the maximun allowed fan number in the array.
|
||||
//! The number of triangle really drawn is :
|
||||
//! VertexNumber()-2*Min(1,BoundNumber())
|
||||
Standard_EXPORT Graphic3d_ArrayOfTriangleFans(const Standard_Integer maxVertexs, const Standard_Integer maxFans = 0, const Standard_Boolean hasVNormals = Standard_False, const Standard_Boolean hasVColors = Standard_False, const Standard_Boolean hasFColors = Standard_False, const Standard_Boolean hasTexels = Standard_False);
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Graphic3d_ArrayOfTriangleFans,Graphic3d_ArrayOfPrimitives)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Graphic3d_ArrayOfTriangleFans_HeaderFile
|
@@ -1,74 +0,0 @@
|
||||
-- Created on: 2001-01-04
|
||||
-- Copyright (c) 2001-2014 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 License 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.
|
||||
|
||||
class ArrayOfTriangleStrips from Graphic3d inherits ArrayOfPrimitives from Graphic3d
|
||||
---Purpose: Contains triangles strip array definition
|
||||
|
||||
is
|
||||
|
||||
-- constructor
|
||||
Create (
|
||||
maxVertexs: Integer from Standard;
|
||||
maxStrips: Integer from Standard = 0;
|
||||
hasVNormals: Boolean from Standard = Standard_False;
|
||||
hasVColors: Boolean from Standard = Standard_False;
|
||||
hasSColors: Boolean from Standard = Standard_False;
|
||||
hasTexels: Boolean from Standard = Standard_False)
|
||||
returns ArrayOfTriangleStrips from Graphic3d;
|
||||
---Purpose: Creates an array of triangle strips,
|
||||
-- a polygon can be filled as:
|
||||
-- 1) creating a single strip defined with his vertexs.
|
||||
-- i.e:
|
||||
-- myArray = Graphic3d_ArrayOfTriangleStrips(7)
|
||||
-- myArray->AddVertex(x1,y1,z1)
|
||||
-- ....
|
||||
-- myArray->AddVertex(x7,y7,z7)
|
||||
-- 2) creating separate strips defined with a predefined
|
||||
-- number of strips and the number of vertex per strip.
|
||||
-- i.e:
|
||||
-- myArray = Graphic3d_ArrayOfTriangleStrips(8,2)
|
||||
-- myArray->AddBound(4)
|
||||
-- myArray->AddVertex(x1,y1,z1)
|
||||
-- ....
|
||||
-- myArray->AddVertex(x4,y4,z4)
|
||||
-- myArray->AddBound(4)
|
||||
-- myArray->AddVertex(x5,y5,z5)
|
||||
-- ....
|
||||
-- myArray->AddVertex(x8,y8,z8)
|
||||
--
|
||||
-- <maxVertexs> defined the maximun allowed vertex number in the array.
|
||||
-- <maxStrips> defined the maximun allowed strip number in the array.
|
||||
-- The number of triangle really drawn is :
|
||||
-- VertexNumber()-2*Min(1,BoundNumber())
|
||||
-- Warning:
|
||||
-- When <hasVNormals> is TRUE , you must use one of
|
||||
-- AddVertex(Point,Normal)
|
||||
-- or AddVertex(Point,Normal,Color)
|
||||
-- or AddVertex(Point,Normal,Texel) methods.
|
||||
-- When <hasVColors> is TRUE , you must use one of
|
||||
-- AddVertex(Point,Color)
|
||||
-- or AddVertex(Point,Normal,Color) methods.
|
||||
-- When <hasTexels> is TRUE , you must use one of
|
||||
-- AddVertex(Point,Texel)
|
||||
-- or AddVertex(Point,Normal,Texel) methods.
|
||||
-- When <hasBColors> is TRUE , <maxBounds> must be > 0 and
|
||||
-- you must use the
|
||||
-- AddBound(number,Color) method.
|
||||
-- Warning:
|
||||
-- the user is responsible about the orientation of the strip
|
||||
-- depending of the order of the created vertex and this
|
||||
-- orientation must be coherent with the vertex normal optionnaly
|
||||
-- given at each vertex (See the Orientate() methods).
|
||||
|
||||
end;
|
@@ -12,7 +12,9 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Graphic3d_ArrayOfTriangleStrips.ixx>
|
||||
|
||||
#include <Graphic3d_ArrayOfTriangleStrips.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
Graphic3d_ArrayOfTriangleStrips::Graphic3d_ArrayOfTriangleStrips (const Standard_Integer theMaxVertexs,
|
||||
const Standard_Integer theMaxStrips,
|
||||
|
105
src/Graphic3d/Graphic3d_ArrayOfTriangleStrips.hxx
Normal file
105
src/Graphic3d/Graphic3d_ArrayOfTriangleStrips.hxx
Normal file
@@ -0,0 +1,105 @@
|
||||
// Created on: 2001-01-04
|
||||
// Copyright (c) 2001-2014 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 License 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_ArrayOfTriangleStrips_HeaderFile
|
||||
#define _Graphic3d_ArrayOfTriangleStrips_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Graphic3d_ArrayOfPrimitives.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
|
||||
|
||||
class Graphic3d_ArrayOfTriangleStrips;
|
||||
DEFINE_STANDARD_HANDLE(Graphic3d_ArrayOfTriangleStrips, Graphic3d_ArrayOfPrimitives)
|
||||
|
||||
//! Contains triangles strip array definition
|
||||
class Graphic3d_ArrayOfTriangleStrips : public Graphic3d_ArrayOfPrimitives
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates an array of triangle strips,
|
||||
//! a polygon can be filled as:
|
||||
//! 1) creating a single strip defined with his vertexs.
|
||||
//! i.e:
|
||||
//! myArray = Graphic3d_ArrayOfTriangleStrips(7)
|
||||
//! myArray->AddVertex(x1,y1,z1)
|
||||
//! ....
|
||||
//! myArray->AddVertex(x7,y7,z7)
|
||||
//! 2) creating separate strips defined with a predefined
|
||||
//! number of strips and the number of vertex per strip.
|
||||
//! i.e:
|
||||
//! myArray = Graphic3d_ArrayOfTriangleStrips(8,2)
|
||||
//! myArray->AddBound(4)
|
||||
//! myArray->AddVertex(x1,y1,z1)
|
||||
//! ....
|
||||
//! myArray->AddVertex(x4,y4,z4)
|
||||
//! myArray->AddBound(4)
|
||||
//! myArray->AddVertex(x5,y5,z5)
|
||||
//! ....
|
||||
//! myArray->AddVertex(x8,y8,z8)
|
||||
//!
|
||||
//! <maxVertexs> defined the maximun allowed vertex number in the array.
|
||||
//! <maxStrips> defined the maximun allowed strip number in the array.
|
||||
//! The number of triangle really drawn is :
|
||||
//! VertexNumber()-2*Min(1,BoundNumber())
|
||||
//! Warning:
|
||||
//! When <hasVNormals> is TRUE , you must use one of
|
||||
//! AddVertex(Point,Normal)
|
||||
//! or AddVertex(Point,Normal,Color)
|
||||
//! or AddVertex(Point,Normal,Texel) methods.
|
||||
//! When <hasVColors> is TRUE , you must use one of
|
||||
//! AddVertex(Point,Color)
|
||||
//! or AddVertex(Point,Normal,Color) methods.
|
||||
//! When <hasTexels> is TRUE , you must use one of
|
||||
//! AddVertex(Point,Texel)
|
||||
//! or AddVertex(Point,Normal,Texel) methods.
|
||||
//! When <hasBColors> is TRUE , <maxBounds> must be > 0 and
|
||||
//! you must use the
|
||||
//! AddBound(number,Color) method.
|
||||
//! Warning:
|
||||
//! the user is responsible about the orientation of the strip
|
||||
//! depending of the order of the created vertex and this
|
||||
//! orientation must be coherent with the vertex normal optionnaly
|
||||
//! given at each vertex (See the Orientate() methods).
|
||||
Standard_EXPORT Graphic3d_ArrayOfTriangleStrips(const Standard_Integer maxVertexs, const Standard_Integer maxStrips = 0, const Standard_Boolean hasVNormals = Standard_False, const Standard_Boolean hasVColors = Standard_False, const Standard_Boolean hasSColors = Standard_False, const Standard_Boolean hasTexels = Standard_False);
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Graphic3d_ArrayOfTriangleStrips,Graphic3d_ArrayOfPrimitives)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Graphic3d_ArrayOfTriangleStrips_HeaderFile
|
@@ -1,69 +0,0 @@
|
||||
-- Created on: 2001-01-04
|
||||
-- Copyright (c) 2001-2014 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 License 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.
|
||||
|
||||
class ArrayOfTriangles from Graphic3d inherits ArrayOfPrimitives from Graphic3d
|
||||
---Purpose: Contains triangles array definition
|
||||
|
||||
is
|
||||
|
||||
-- constructor
|
||||
Create (
|
||||
maxVertexs: Integer from Standard;
|
||||
maxEdges: Integer from Standard = 0;
|
||||
hasVNormals: Boolean from Standard = Standard_False;
|
||||
hasVColors: Boolean from Standard = Standard_False;
|
||||
hasTexels: Boolean from Standard = Standard_False)
|
||||
returns ArrayOfTriangles from Graphic3d;
|
||||
---Purpose: Creates an array of triangles,
|
||||
-- a triangle can be filled as:
|
||||
-- 1) creating a set of triangles defined with his vertexs.
|
||||
-- i.e:
|
||||
-- myArray = Graphic3d_ArrayOfTriangles(6)
|
||||
-- myArray->AddVertex(x1,y1,z1)
|
||||
-- ....
|
||||
-- myArray->AddVertex(x6,y6,z6)
|
||||
-- 3) creating a set of indexed triangles defined with his vertex
|
||||
-- ans edges.
|
||||
-- i.e:
|
||||
-- myArray = Graphic3d_ArrayOfTriangles(4,6)
|
||||
-- myArray->AddVertex(x1,y1,z1)
|
||||
-- ....
|
||||
-- myArray->AddVertex(x4,y4,z4)
|
||||
-- myArray->AddEdge(1)
|
||||
-- myArray->AddEdge(2)
|
||||
-- myArray->AddEdge(3)
|
||||
-- myArray->AddEdge(2)
|
||||
-- myArray->AddEdge(3)
|
||||
-- myArray->AddEdge(4)
|
||||
--
|
||||
-- <maxVertexs> defined the maximun allowed vertex number in the array.
|
||||
-- <maxEdges> defined the maximun allowed edge number in the array.
|
||||
-- Warning:
|
||||
-- When <hasVNormals> is TRUE , you must use one of
|
||||
-- AddVertex(Point,Normal)
|
||||
-- or AddVertex(Point,Normal,Color)
|
||||
-- or AddVertex(Point,Normal,Texel) methods.
|
||||
-- When <hasVColors> is TRUE , you must use one of
|
||||
-- AddVertex(Point,Color)
|
||||
-- or AddVertex(Point,Normal,Color) methods.
|
||||
-- When <hasTexels> is TRUE , you must use one of
|
||||
-- AddVertex(Point,Texel)
|
||||
-- or AddVertex(Point,Normal,Texel) methods.
|
||||
-- Warning:
|
||||
-- the user is responsible about the orientation of the triangle
|
||||
-- depending of the order of the created vertex or edges and this
|
||||
-- orientation must be coherent with the vertex normal optionnaly
|
||||
-- given at each vertex (See the Orientate() methods).
|
||||
|
||||
end;
|
@@ -12,7 +12,9 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Graphic3d_ArrayOfTriangles.ixx>
|
||||
|
||||
#include <Graphic3d_ArrayOfTriangles.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
Graphic3d_ArrayOfTriangles::Graphic3d_ArrayOfTriangles (const Standard_Integer theMaxVertexs,
|
||||
const Standard_Integer theMaxEdges,
|
||||
|
101
src/Graphic3d/Graphic3d_ArrayOfTriangles.hxx
Normal file
101
src/Graphic3d/Graphic3d_ArrayOfTriangles.hxx
Normal file
@@ -0,0 +1,101 @@
|
||||
// Created on: 2001-01-04
|
||||
// Copyright (c) 2001-2014 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 License 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_ArrayOfTriangles_HeaderFile
|
||||
#define _Graphic3d_ArrayOfTriangles_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Graphic3d_ArrayOfPrimitives.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
|
||||
|
||||
class Graphic3d_ArrayOfTriangles;
|
||||
DEFINE_STANDARD_HANDLE(Graphic3d_ArrayOfTriangles, Graphic3d_ArrayOfPrimitives)
|
||||
|
||||
//! Contains triangles array definition
|
||||
class Graphic3d_ArrayOfTriangles : public Graphic3d_ArrayOfPrimitives
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates an array of triangles,
|
||||
//! a triangle can be filled as:
|
||||
//! 1) creating a set of triangles defined with his vertexs.
|
||||
//! i.e:
|
||||
//! myArray = Graphic3d_ArrayOfTriangles(6)
|
||||
//! myArray->AddVertex(x1,y1,z1)
|
||||
//! ....
|
||||
//! myArray->AddVertex(x6,y6,z6)
|
||||
//! 3) creating a set of indexed triangles defined with his vertex
|
||||
//! ans edges.
|
||||
//! i.e:
|
||||
//! myArray = Graphic3d_ArrayOfTriangles(4,6)
|
||||
//! myArray->AddVertex(x1,y1,z1)
|
||||
//! ....
|
||||
//! myArray->AddVertex(x4,y4,z4)
|
||||
//! myArray->AddEdge(1)
|
||||
//! myArray->AddEdge(2)
|
||||
//! myArray->AddEdge(3)
|
||||
//! myArray->AddEdge(2)
|
||||
//! myArray->AddEdge(3)
|
||||
//! myArray->AddEdge(4)
|
||||
//!
|
||||
//! <maxVertexs> defined the maximun allowed vertex number in the array.
|
||||
//! <maxEdges> defined the maximun allowed edge number in the array.
|
||||
//! Warning:
|
||||
//! When <hasVNormals> is TRUE , you must use one of
|
||||
//! AddVertex(Point,Normal)
|
||||
//! or AddVertex(Point,Normal,Color)
|
||||
//! or AddVertex(Point,Normal,Texel) methods.
|
||||
//! When <hasVColors> is TRUE , you must use one of
|
||||
//! AddVertex(Point,Color)
|
||||
//! or AddVertex(Point,Normal,Color) methods.
|
||||
//! When <hasTexels> is TRUE , you must use one of
|
||||
//! AddVertex(Point,Texel)
|
||||
//! or AddVertex(Point,Normal,Texel) methods.
|
||||
//! Warning:
|
||||
//! the user is responsible about the orientation of the triangle
|
||||
//! depending of the order of the created vertex or edges and this
|
||||
//! orientation must be coherent with the vertex normal optionnaly
|
||||
//! given at each vertex (See the Orientate() methods).
|
||||
Standard_EXPORT Graphic3d_ArrayOfTriangles(const Standard_Integer maxVertexs, const Standard_Integer maxEdges = 0, const Standard_Boolean hasVNormals = Standard_False, const Standard_Boolean hasVColors = Standard_False, const Standard_Boolean hasTexels = Standard_False);
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Graphic3d_ArrayOfTriangles,Graphic3d_ArrayOfPrimitives)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Graphic3d_ArrayOfTriangles_HeaderFile
|
@@ -1,304 +0,0 @@
|
||||
-- Created on: 1991-11-04
|
||||
-- Created by: NW,JPB,CAL
|
||||
-- Copyright (c) 1991-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 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 License 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.
|
||||
|
||||
-- Modified: 1/08/97 ; PCT : Ajout texture mapping
|
||||
-- 16/01/98 ; FMN : Ajout Hiddenline
|
||||
-- 0312/99 ; GG : BUC60488 Why the field DistinguishModeActive
|
||||
-- field is not accessible properly ?
|
||||
-- workaround : Move the Material fields at end.
|
||||
-- 22/03/04 ; OCC4895 SAN High-level interface for controlling polygon offsets
|
||||
|
||||
class AspectFillArea3d from Graphic3d inherits AspectFillArea from Aspect
|
||||
|
||||
---Version:
|
||||
|
||||
---Purpose: This class permits the creation and updating of
|
||||
-- a graphic attribute context for opaque 3d
|
||||
-- primitives (polygons, triangles, quadrilaterals)
|
||||
-- Keywords: Face, FillArea, Triangle, Quadrangle, Polygon,
|
||||
-- TriangleMesh, QuadrangleMesh, Edge, Border, Interior,
|
||||
-- Color, Type, Width, Style, Hatch, Material,
|
||||
-- BackFaceRemoval, DistinguishMode
|
||||
|
||||
---Warning:
|
||||
---References:
|
||||
|
||||
uses
|
||||
|
||||
Color from Quantity,
|
||||
Ratio from Quantity,
|
||||
|
||||
TypeOfLine from Aspect,
|
||||
InteriorStyle from Aspect,
|
||||
|
||||
MaterialAspect from Graphic3d,
|
||||
TextureMap from Graphic3d,
|
||||
|
||||
ShaderProgram from Graphic3d
|
||||
|
||||
is
|
||||
|
||||
Create
|
||||
returns AspectFillArea3d from Graphic3d;
|
||||
---Level: Public
|
||||
---Purpose: Creates a context table for fill area primitives
|
||||
-- defined with the following default values:
|
||||
--
|
||||
-- InteriorStyle : IS_EMPTY
|
||||
-- InteriorColor : NOC_CYAN1
|
||||
-- EdgeColor : NOC_WHITE
|
||||
-- EdgeLineType : TOL_SOLID
|
||||
-- EdgeWidth : 1.0
|
||||
-- FrontMaterial : NOM_BRASS
|
||||
-- BackMaterial : NOM_BRASS
|
||||
--
|
||||
-- Display of back-facing filled polygons.
|
||||
-- No distinction between external and internal
|
||||
-- faces of FillAreas.
|
||||
-- The edges are not drawn.
|
||||
-- Polygon offset parameters: mode = Aspect_POM_None, factor = 1., units = 0.
|
||||
|
||||
|
||||
Create ( Interior : InteriorStyle from Aspect;
|
||||
InteriorColor : Color from Quantity;
|
||||
EdgeColor : Color from Quantity;
|
||||
EdgeLineType : TypeOfLine from Aspect;
|
||||
EdgeWidth : Real from Standard;
|
||||
FrontMaterial : MaterialAspect from Graphic3d;
|
||||
BackMaterial : MaterialAspect from Graphic3d )
|
||||
returns AspectFillArea3d from Graphic3d;
|
||||
|
||||
---Level: Public
|
||||
---Purpose: Creates a context table for fill area primitives
|
||||
-- defined with the specified values.
|
||||
--
|
||||
-- Display of back-facing filled polygons.
|
||||
-- No distinction between external and internal
|
||||
-- faces of FillAreas.
|
||||
-- The edges are not drawn.
|
||||
-- Polygon offset parameters: mode = Aspect_POM_None, factor = 1., units = 0.
|
||||
-- Warning
|
||||
-- EdgeWidth is the "line width scale factor". The
|
||||
-- nominal line width is 1 pixel. The width of the line is
|
||||
-- determined by applying the line width scale factor to
|
||||
-- this nominal line width. The supported line widths
|
||||
-- vary by 1-pixel units.
|
||||
|
||||
---------------------------------------------------
|
||||
-- Category: Methods to modify the class definition
|
||||
---------------------------------------------------
|
||||
|
||||
AllowBackFace ( me : mutable )
|
||||
is static;
|
||||
---Purpose: Allows the display of back-facing filled
|
||||
-- polygons.
|
||||
|
||||
SetBackMaterial ( me : mutable;
|
||||
AMaterial : MaterialAspect from Graphic3d )
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Modifies the surface material of internal faces
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
SetDistinguishOn ( me : mutable )
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Allows distinction between external and internal
|
||||
-- faces of FillAreas.
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
SetDistinguishOff ( me : mutable )
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Forbids distinction between external and internal
|
||||
-- faces of FillAreas.
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
SetEdgeOn ( me : mutable )
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: The edges of FillAreas are drawn.
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
SetEdgeOff ( me : mutable )
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: The edges of FillAreas are not drawn.
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
SetFrontMaterial ( me : mutable;
|
||||
AMaterial : MaterialAspect from Graphic3d )
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Modifies the surface material of external faces
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
SuppressBackFace ( me : mutable )
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Suppress the display of back-facing filled
|
||||
-- polygons.
|
||||
-- A back-facing polygon is defined as a polygon whose
|
||||
-- vertices are in a clockwise order with respect
|
||||
-- to screen coordinates.
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
|
||||
SetTextureMap(me : mutable;
|
||||
ATexture : TextureMap from Graphic3d);
|
||||
|
||||
SetTextureMapOn(me : mutable);
|
||||
SetTextureMapOff(me : mutable);
|
||||
|
||||
-- 22-03-04 OCC4895 SAN High-level interface for controlling polygon offsets
|
||||
SetPolygonOffsets ( me : mutable;
|
||||
aMode : Integer from Standard;
|
||||
aFactor : ShortReal from Standard = 1.0;
|
||||
aUnits : ShortReal from Standard = 0.0 );
|
||||
---Level: Public
|
||||
---Purpose: Sets up OpenGL polygon offsets mechanism.
|
||||
-- <aMode> parameter can contain various combinations of
|
||||
-- Aspect_PolygonOffsetMode enumeration elements (Aspect_POM_None means
|
||||
-- that polygon offsets are not changed).
|
||||
-- If <aMode> is different from Aspect_POM_Off and Aspect_POM_None, then <aFactor> and <aUnits>
|
||||
-- arguments are used by graphic renderer to calculate a depth offset value:
|
||||
--
|
||||
-- offset = <aFactor> * m + <aUnits> * r, where
|
||||
-- m - maximum depth slope for the polygon currently being displayed,
|
||||
-- r - minimum window coordinates depth resolution (implementation-specific)
|
||||
--
|
||||
-- Deafult settings for OCC 3D viewer: mode = Aspect_POM_Fill, factor = 1., units = 0.
|
||||
--
|
||||
-- Negative offset values move polygons closer to the viewport,
|
||||
-- while positive values shift polygons away.
|
||||
-- Consult OpenGL reference for details (glPolygonOffset function description).
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
SetShaderProgram ( me : mutable;
|
||||
theProgram : ShaderProgram from Graphic3d );
|
||||
---Level: Public
|
||||
---Purpose: Sets up OpenGL/GLSL shader program.
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
----------------------------
|
||||
-- Category: Inquire methods
|
||||
----------------------------
|
||||
|
||||
BackFace ( me )
|
||||
returns Boolean from Standard
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns the Back Face Removal status.
|
||||
-- Standard_True if SuppressBackFace is activated.
|
||||
---Category: Inquire methods
|
||||
|
||||
Distinguish ( me )
|
||||
returns Boolean from Standard
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns the Distinguish Mode status.
|
||||
---Category: Inquire methods
|
||||
|
||||
Edge ( me )
|
||||
returns Boolean from Standard
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns Standard_True if the edges are drawn and
|
||||
-- Standard_False if the edges are not drawn.
|
||||
---Category: Inquire methods
|
||||
|
||||
BackMaterial ( me )
|
||||
returns MaterialAspect from Graphic3d
|
||||
is static;
|
||||
---C++: return const&
|
||||
---Level: Public
|
||||
---Purpose: Returns the surface material of internal faces
|
||||
---Category: Inquire methods
|
||||
|
||||
FrontMaterial ( me )
|
||||
returns MaterialAspect from Graphic3d
|
||||
is static;
|
||||
---C++: return const&
|
||||
---Level: Public
|
||||
---Purpose: Returns the surface material of external faces
|
||||
---Category: Inquire methods
|
||||
|
||||
|
||||
TextureMap(me)
|
||||
returns TextureMap from Graphic3d;
|
||||
|
||||
TextureMapState(me)
|
||||
returns Boolean from Standard;
|
||||
|
||||
-- 22-03-04 OCC4895 SAN High-level interface for controlling polygon offsets
|
||||
PolygonOffsets ( me;
|
||||
aMode : out Integer from Standard;
|
||||
aFactor : out ShortReal from Standard;
|
||||
aUnits : out ShortReal from Standard );
|
||||
---Level: Public
|
||||
---Purpose: Returns current polygon offsets settings.
|
||||
---Category: Inquire methods
|
||||
|
||||
ShaderProgram ( me )
|
||||
returns ShaderProgram from Graphic3d;
|
||||
---C++: return const &
|
||||
|
||||
--
|
||||
|
||||
fields
|
||||
|
||||
--
|
||||
-- Class : Graphic3d_AspectFillArea3d
|
||||
--
|
||||
-- Purpose : Declaration of variables specific to
|
||||
-- the context of drawing 3d faces
|
||||
--
|
||||
-- Reminder : A context for drawing 3d faces inherits a context
|
||||
-- defined by :
|
||||
-- - the interior style of the face
|
||||
-- - the edge style of the face
|
||||
-- - the colour
|
||||
-- It also possesses a definition of the materials for the
|
||||
-- internal and external faces.
|
||||
--
|
||||
--
|
||||
|
||||
|
||||
-- flag to distinguish between internal and external faces
|
||||
DistinguishModeActive : Boolean from Standard;
|
||||
|
||||
-- flag to draw the edges or not
|
||||
EdgeModeActive : Boolean from Standard;
|
||||
|
||||
-- display flag for reversed polygons.
|
||||
BackFaceRemovalActive : Boolean from Standard;
|
||||
|
||||
MyTextureMap : TextureMap from Graphic3d;
|
||||
MyTextureMapState : Boolean from Standard;
|
||||
|
||||
-- the material
|
||||
MyFrontMaterial : MaterialAspect from Graphic3d;
|
||||
MyBackMaterial : MaterialAspect from Graphic3d;
|
||||
|
||||
-- 22-03-04 OCC4895 SAN High-level interface for controlling polygon offsets
|
||||
-- polygon offsets
|
||||
MyPolygonOffsetMode : Integer from Standard;
|
||||
MyPolygonOffsetFactor : ShortReal from Standard;
|
||||
MyPolygonOffsetUnits : ShortReal from Standard;
|
||||
|
||||
MyShaderProgram : ShaderProgram from Graphic3d;
|
||||
|
||||
end AspectFillArea3d;
|
@@ -15,7 +15,6 @@
|
||||
|
||||
//-Design Declaration of variables specific to the context
|
||||
// of tracing of facets 3D
|
||||
|
||||
//-Warning Ccontext of tracing of facets 3d inherits the context
|
||||
// defined by :
|
||||
// - the style of the interior of the facet
|
||||
@@ -23,12 +22,15 @@
|
||||
// - the color
|
||||
// Additionally, it has more than one definition of material
|
||||
// for internal and external faces.
|
||||
|
||||
// for the class
|
||||
#include <Graphic3d_AspectFillArea3d.ixx>
|
||||
|
||||
#include <Aspect_PolygonOffsetMode.hxx>
|
||||
#include <Graphic3d_AspectFillArea3d.hxx>
|
||||
#include <Graphic3d_MaterialAspect.hxx>
|
||||
#include <Graphic3d_TextureMap.hxx>
|
||||
#include <Quantity_Color.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
Graphic3d_AspectFillArea3d::Graphic3d_AspectFillArea3d ():
|
||||
DistinguishModeActive (Standard_False), EdgeModeActive (Standard_False), BackFaceRemovalActive (Standard_False), MyTextureMapState(Standard_False), MyFrontMaterial (), MyBackMaterial ()
|
||||
|
205
src/Graphic3d/Graphic3d_AspectFillArea3d.hxx
Normal file
205
src/Graphic3d/Graphic3d_AspectFillArea3d.hxx
Normal file
@@ -0,0 +1,205 @@
|
||||
// Created on: 1991-11-04
|
||||
// Created by: NW,JPB,CAL
|
||||
// Copyright (c) 1991-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 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 License 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_AspectFillArea3d_HeaderFile
|
||||
#define _Graphic3d_AspectFillArea3d_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Graphic3d_MaterialAspect.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Standard_ShortReal.hxx>
|
||||
#include <Graphic3d_ShaderProgram.hxx>
|
||||
#include <Aspect_AspectFillArea.hxx>
|
||||
#include <Aspect_InteriorStyle.hxx>
|
||||
#include <Aspect_TypeOfLine.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
class Graphic3d_TextureMap;
|
||||
class Quantity_Color;
|
||||
class Graphic3d_MaterialAspect;
|
||||
|
||||
|
||||
class Graphic3d_AspectFillArea3d;
|
||||
DEFINE_STANDARD_HANDLE(Graphic3d_AspectFillArea3d, Aspect_AspectFillArea)
|
||||
|
||||
//! This class permits the creation and updating of
|
||||
//! a graphic attribute context for opaque 3d
|
||||
//! primitives (polygons, triangles, quadrilaterals)
|
||||
//! Keywords: Face, FillArea, Triangle, Quadrangle, Polygon,
|
||||
//! TriangleMesh, QuadrangleMesh, Edge, Border, Interior,
|
||||
//! Color, Type, Width, Style, Hatch, Material,
|
||||
//! BackFaceRemoval, DistinguishMode
|
||||
class Graphic3d_AspectFillArea3d : public Aspect_AspectFillArea
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates a context table for fill area primitives
|
||||
//! defined with the following default values:
|
||||
//!
|
||||
//! InteriorStyle : IS_EMPTY
|
||||
//! InteriorColor : NOC_CYAN1
|
||||
//! EdgeColor : NOC_WHITE
|
||||
//! EdgeLineType : TOL_SOLID
|
||||
//! EdgeWidth : 1.0
|
||||
//! FrontMaterial : NOM_BRASS
|
||||
//! BackMaterial : NOM_BRASS
|
||||
//!
|
||||
//! Display of back-facing filled polygons.
|
||||
//! No distinction between external and internal
|
||||
//! faces of FillAreas.
|
||||
//! The edges are not drawn.
|
||||
//! Polygon offset parameters: mode = Aspect_POM_None, factor = 1., units = 0.
|
||||
Standard_EXPORT Graphic3d_AspectFillArea3d();
|
||||
|
||||
//! Creates a context table for fill area primitives
|
||||
//! defined with the specified values.
|
||||
//!
|
||||
//! Display of back-facing filled polygons.
|
||||
//! No distinction between external and internal
|
||||
//! faces of FillAreas.
|
||||
//! The edges are not drawn.
|
||||
//! Polygon offset parameters: mode = Aspect_POM_None, factor = 1., units = 0.
|
||||
//! Warning
|
||||
//! EdgeWidth is the "line width scale factor". The
|
||||
//! nominal line width is 1 pixel. The width of the line is
|
||||
//! determined by applying the line width scale factor to
|
||||
//! this nominal line width. The supported line widths
|
||||
//! vary by 1-pixel units.
|
||||
Standard_EXPORT Graphic3d_AspectFillArea3d(const Aspect_InteriorStyle Interior, const Quantity_Color& InteriorColor, const Quantity_Color& EdgeColor, const Aspect_TypeOfLine EdgeLineType, const Standard_Real EdgeWidth, const Graphic3d_MaterialAspect& FrontMaterial, const Graphic3d_MaterialAspect& BackMaterial);
|
||||
|
||||
//! Allows the display of back-facing filled
|
||||
//! polygons.
|
||||
Standard_EXPORT void AllowBackFace();
|
||||
|
||||
//! Modifies the surface material of internal faces
|
||||
Standard_EXPORT void SetBackMaterial (const Graphic3d_MaterialAspect& AMaterial);
|
||||
|
||||
//! Allows distinction between external and internal
|
||||
//! faces of FillAreas.
|
||||
Standard_EXPORT void SetDistinguishOn();
|
||||
|
||||
//! Forbids distinction between external and internal
|
||||
//! faces of FillAreas.
|
||||
Standard_EXPORT void SetDistinguishOff();
|
||||
|
||||
//! The edges of FillAreas are drawn.
|
||||
Standard_EXPORT void SetEdgeOn();
|
||||
|
||||
//! The edges of FillAreas are not drawn.
|
||||
Standard_EXPORT void SetEdgeOff();
|
||||
|
||||
//! Modifies the surface material of external faces
|
||||
Standard_EXPORT void SetFrontMaterial (const Graphic3d_MaterialAspect& AMaterial);
|
||||
|
||||
//! Suppress the display of back-facing filled
|
||||
//! polygons.
|
||||
//! A back-facing polygon is defined as a polygon whose
|
||||
//! vertices are in a clockwise order with respect
|
||||
//! to screen coordinates.
|
||||
Standard_EXPORT void SuppressBackFace();
|
||||
|
||||
Standard_EXPORT void SetTextureMap (const Handle(Graphic3d_TextureMap)& ATexture);
|
||||
|
||||
Standard_EXPORT void SetTextureMapOn();
|
||||
|
||||
Standard_EXPORT void SetTextureMapOff();
|
||||
|
||||
//! Sets up OpenGL polygon offsets mechanism.
|
||||
//! <aMode> parameter can contain various combinations of
|
||||
//! Aspect_PolygonOffsetMode enumeration elements (Aspect_POM_None means
|
||||
//! that polygon offsets are not changed).
|
||||
//! If <aMode> is different from Aspect_POM_Off and Aspect_POM_None, then <aFactor> and <aUnits>
|
||||
//! arguments are used by graphic renderer to calculate a depth offset value:
|
||||
//!
|
||||
//! offset = <aFactor> * m + <aUnits> * r, where
|
||||
//! m - maximum depth slope for the polygon currently being displayed,
|
||||
//! r - minimum window coordinates depth resolution (implementation-specific)
|
||||
//!
|
||||
//! Deafult settings for OCC 3D viewer: mode = Aspect_POM_Fill, factor = 1., units = 0.
|
||||
//!
|
||||
//! Negative offset values move polygons closer to the viewport,
|
||||
//! while positive values shift polygons away.
|
||||
//! Consult OpenGL reference for details (glPolygonOffset function description).
|
||||
Standard_EXPORT void SetPolygonOffsets (const Standard_Integer aMode, const Standard_ShortReal aFactor = 1.0, const Standard_ShortReal aUnits = 0.0);
|
||||
|
||||
//! Sets up OpenGL/GLSL shader program.
|
||||
Standard_EXPORT void SetShaderProgram (const Handle(Graphic3d_ShaderProgram)& theProgram);
|
||||
|
||||
//! Returns the Back Face Removal status.
|
||||
//! Standard_True if SuppressBackFace is activated.
|
||||
Standard_EXPORT Standard_Boolean BackFace() const;
|
||||
|
||||
//! Returns the Distinguish Mode status.
|
||||
Standard_EXPORT Standard_Boolean Distinguish() const;
|
||||
|
||||
//! Returns Standard_True if the edges are drawn and
|
||||
//! Standard_False if the edges are not drawn.
|
||||
Standard_EXPORT Standard_Boolean Edge() const;
|
||||
|
||||
//! Returns the surface material of internal faces
|
||||
Standard_EXPORT const Graphic3d_MaterialAspect& BackMaterial() const;
|
||||
|
||||
//! Returns the surface material of external faces
|
||||
Standard_EXPORT const Graphic3d_MaterialAspect& FrontMaterial() const;
|
||||
|
||||
Standard_EXPORT Handle(Graphic3d_TextureMap) TextureMap() const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean TextureMapState() const;
|
||||
|
||||
//! Returns current polygon offsets settings.
|
||||
Standard_EXPORT void PolygonOffsets (Standard_Integer& aMode, Standard_ShortReal& aFactor, Standard_ShortReal& aUnits) const;
|
||||
|
||||
Standard_EXPORT const Handle(Graphic3d_ShaderProgram)& ShaderProgram() const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Graphic3d_AspectFillArea3d,Aspect_AspectFillArea)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_Boolean DistinguishModeActive;
|
||||
Standard_Boolean EdgeModeActive;
|
||||
Standard_Boolean BackFaceRemovalActive;
|
||||
Handle(Graphic3d_TextureMap) MyTextureMap;
|
||||
Standard_Boolean MyTextureMapState;
|
||||
Graphic3d_MaterialAspect MyFrontMaterial;
|
||||
Graphic3d_MaterialAspect MyBackMaterial;
|
||||
Standard_Integer MyPolygonOffsetMode;
|
||||
Standard_ShortReal MyPolygonOffsetFactor;
|
||||
Standard_ShortReal MyPolygonOffsetUnits;
|
||||
Handle(Graphic3d_ShaderProgram) MyShaderProgram;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Graphic3d_AspectFillArea3d_HeaderFile
|
@@ -1,82 +0,0 @@
|
||||
-- Created by: NW,JPB,CAL
|
||||
-- Copyright (c) 1991-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 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 License 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.
|
||||
|
||||
class AspectLine3d from Graphic3d inherits AspectLine from Aspect
|
||||
|
||||
---Version:
|
||||
|
||||
---Purpose: Creates and updates a group of attributes
|
||||
-- for 3d line primitives. This group contains the
|
||||
-- colour, the type of line, and its thickness.
|
||||
|
||||
|
||||
uses
|
||||
|
||||
Color from Quantity,
|
||||
TypeOfLine from Aspect,
|
||||
ShaderProgram from Graphic3d
|
||||
|
||||
is
|
||||
|
||||
Create
|
||||
returns AspectLine3d from Graphic3d;
|
||||
---Level: Public
|
||||
---Purpose: Creates a context table for line primitives
|
||||
-- defined with the following default values:
|
||||
--
|
||||
-- Colour : NOC_YELLOW
|
||||
-- Line type : TOL_SOLID
|
||||
-- Width : 1.0
|
||||
|
||||
Create ( AColor : Color from Quantity;
|
||||
AType : TypeOfLine from Aspect;
|
||||
AWidth : Real from Standard )
|
||||
returns AspectLine3d from Graphic3d;
|
||||
---Level: Public
|
||||
---Purpose: Creates a context table for line primitives
|
||||
-- defined with the specified values.
|
||||
-- Warning: <AWidth> is the "linewidth scale factor".
|
||||
-- The nominal line width is 1 pixel. The width of
|
||||
-- the line is determined by applying the linewidth scale
|
||||
-- factor to this nominal line width.
|
||||
-- The supported linewidths vary by 1-pixel units.
|
||||
|
||||
SetShaderProgram ( me : mutable;
|
||||
theProgram : ShaderProgram from Graphic3d );
|
||||
---Level: Public
|
||||
---Purpose: Sets up OpenGL/GLSL shader program.
|
||||
|
||||
ShaderProgram ( me )
|
||||
returns ShaderProgram from Graphic3d;
|
||||
---C++: return const &
|
||||
|
||||
fields
|
||||
|
||||
--
|
||||
-- Class : Graphic3d_AspectLine3d
|
||||
--
|
||||
-- Purpose : Declaration of context-specific variables
|
||||
-- for drawing 3d lines
|
||||
--
|
||||
-- Reminder : A context for drawing 3d lines inherits:
|
||||
-- - the colour
|
||||
-- - the type of line
|
||||
-- - the thickness
|
||||
-- defined by AspectLine.
|
||||
--
|
||||
|
||||
MyShaderProgram : ShaderProgram from Graphic3d;
|
||||
|
||||
end AspectLine3d;
|
@@ -14,35 +14,27 @@
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
//-Version
|
||||
|
||||
//-Design Declaration of variables specific to the context
|
||||
// of tracing of lines 3d
|
||||
|
||||
//-Warning Context of tracing of lines 3d inherits the context
|
||||
// defined by :
|
||||
// - the color
|
||||
// - the type of trait
|
||||
// - the thickness
|
||||
|
||||
//-References
|
||||
|
||||
//-Language C++ 2.0
|
||||
|
||||
//-Declarations
|
||||
|
||||
// for the class
|
||||
#include <Graphic3d_AspectLine3d.ixx>
|
||||
|
||||
#include <Graphic3d_AspectLine3d.hxx>
|
||||
#include <Quantity_Color.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
//-Aliases
|
||||
|
||||
//-Global data definitions
|
||||
|
||||
//-Constructors
|
||||
|
||||
//-Destructors
|
||||
|
||||
//-Methods, in order
|
||||
|
||||
Graphic3d_AspectLine3d::Graphic3d_AspectLine3d () {
|
||||
}
|
||||
|
||||
|
87
src/Graphic3d/Graphic3d_AspectLine3d.hxx
Normal file
87
src/Graphic3d/Graphic3d_AspectLine3d.hxx
Normal file
@@ -0,0 +1,87 @@
|
||||
// Created by: NW,JPB,CAL
|
||||
// Copyright (c) 1991-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 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 License 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_AspectLine3d_HeaderFile
|
||||
#define _Graphic3d_AspectLine3d_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Graphic3d_ShaderProgram.hxx>
|
||||
#include <Aspect_AspectLine.hxx>
|
||||
#include <Aspect_TypeOfLine.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
class Quantity_Color;
|
||||
|
||||
|
||||
class Graphic3d_AspectLine3d;
|
||||
DEFINE_STANDARD_HANDLE(Graphic3d_AspectLine3d, Aspect_AspectLine)
|
||||
|
||||
//! Creates and updates a group of attributes
|
||||
//! for 3d line primitives. This group contains the
|
||||
//! colour, the type of line, and its thickness.
|
||||
class Graphic3d_AspectLine3d : public Aspect_AspectLine
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates a context table for line primitives
|
||||
//! defined with the following default values:
|
||||
//!
|
||||
//! Colour : NOC_YELLOW
|
||||
//! Line type : TOL_SOLID
|
||||
//! Width : 1.0
|
||||
Standard_EXPORT Graphic3d_AspectLine3d();
|
||||
|
||||
//! Creates a context table for line primitives
|
||||
//! defined with the specified values.
|
||||
//! Warning: <AWidth> is the "linewidth scale factor".
|
||||
//! The nominal line width is 1 pixel. The width of
|
||||
//! the line is determined by applying the linewidth scale
|
||||
//! factor to this nominal line width.
|
||||
//! The supported linewidths vary by 1-pixel units.
|
||||
Standard_EXPORT Graphic3d_AspectLine3d(const Quantity_Color& AColor, const Aspect_TypeOfLine AType, const Standard_Real AWidth);
|
||||
|
||||
//! Sets up OpenGL/GLSL shader program.
|
||||
Standard_EXPORT void SetShaderProgram (const Handle(Graphic3d_ShaderProgram)& theProgram);
|
||||
|
||||
Standard_EXPORT const Handle(Graphic3d_ShaderProgram)& ShaderProgram() const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Graphic3d_AspectLine3d,Aspect_AspectLine)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Handle(Graphic3d_ShaderProgram) MyShaderProgram;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Graphic3d_AspectLine3d_HeaderFile
|
@@ -1,120 +0,0 @@
|
||||
-- Created by: NW,JPB,CAL
|
||||
-- Copyright (c) 1991-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 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 License 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.
|
||||
|
||||
class AspectMarker3d from Graphic3d inherits AspectMarker from Aspect
|
||||
|
||||
---Version:
|
||||
|
||||
---Purpose: Creates and updates an attribute group for
|
||||
-- marker type primitives. This group contains the type
|
||||
-- of marker, its colour, and its scale factor.
|
||||
---Keywords: Marker, Color, Scale, Type
|
||||
|
||||
---Warning:
|
||||
---References:
|
||||
|
||||
uses
|
||||
|
||||
Color from Quantity,
|
||||
TypeOfMarker from Aspect,
|
||||
HArray1OfByte from TColStd,
|
||||
PixMap_Handle from Image,
|
||||
MarkerImage from Graphic3d,
|
||||
ShaderProgram from Graphic3d
|
||||
|
||||
is
|
||||
|
||||
Create
|
||||
returns AspectMarker3d from Graphic3d;
|
||||
---Level: Public
|
||||
---Purpose: Creates a context table for marker primitives
|
||||
-- defined with the following default values:
|
||||
--
|
||||
-- Marker type : TOM_X
|
||||
-- Colour : YELLOW
|
||||
-- Scale factor: 1.0
|
||||
|
||||
Create (theType : TypeOfMarker from Aspect;
|
||||
theColor : Color from Quantity;
|
||||
theScale : Real from Standard)
|
||||
returns AspectMarker3d from Graphic3d;
|
||||
|
||||
Create (theColor : Color from Quantity;
|
||||
theWidth : Integer from Standard;
|
||||
theHeight : Integer from Standard;
|
||||
theTextureBitmap : HArray1OfByte from TColStd)
|
||||
returns AspectMarker3d from Graphic3d;
|
||||
---Level: Public
|
||||
---Purpose: Creates a context table for marker primitives
|
||||
-- defined with the specified values.
|
||||
|
||||
Create (theTextureImage : PixMap_Handle from Image)
|
||||
returns AspectMarker3d from Graphic3d;
|
||||
---Level: Public
|
||||
---Purpose: Creates a context table for marker primitives
|
||||
-- defined with the specified values.
|
||||
|
||||
GetTextureSize (me;
|
||||
theWidth : out Integer from Standard;
|
||||
theHeight: out Integer from Standard);
|
||||
---Level: Public
|
||||
---Purpose: Returns marker's texture size.
|
||||
|
||||
GetMarkerImage (me)
|
||||
returns MarkerImage from Graphic3d;
|
||||
---Level: Public
|
||||
---Purpose: Returns marker's image texture.
|
||||
--- Could be null handle if marker aspect has been initialized as
|
||||
--- default type of marker.
|
||||
---C++: return const &
|
||||
|
||||
SetMarkerImage (me : mutable;
|
||||
theImage : MarkerImage from Graphic3d);
|
||||
---Level: Public
|
||||
---Purpose: Set marker's image texture.
|
||||
|
||||
SetBitMap (me: mutable;
|
||||
theWidth : Integer from Standard;
|
||||
theHeight : Integer from Standard;
|
||||
theTexture: HArray1OfByte from TColStd ) is static;
|
||||
|
||||
SetShaderProgram ( me : mutable;
|
||||
theProgram : ShaderProgram from Graphic3d );
|
||||
---Level: Public
|
||||
---Purpose: Sets up OpenGL/GLSL shader program.
|
||||
|
||||
ShaderProgram ( me )
|
||||
returns ShaderProgram from Graphic3d;
|
||||
---C++: return const &
|
||||
|
||||
fields
|
||||
|
||||
--
|
||||
-- Class: Graphic3d_AspectMarker3d
|
||||
--
|
||||
-- Purpose: Declaration of context-specific variables
|
||||
-- for drawing 3d markers.
|
||||
--
|
||||
-- Reminder: A context for drawing 3d markers inherits:
|
||||
-- - the colour
|
||||
-- - the type of marker
|
||||
-- - the scale factor
|
||||
-- defined by AspectMarker.
|
||||
|
||||
myMarkerImage : MarkerImage from Graphic3d is protected;
|
||||
|
||||
MyShaderProgram : ShaderProgram from Graphic3d;
|
||||
|
||||
end AspectMarker3d;
|
@@ -13,10 +13,13 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Graphic3d_AspectMarker3d.ixx>
|
||||
#include <TColStd_Array1OfByte.hxx>
|
||||
#include <Image_PixMap.hxx>
|
||||
|
||||
#include <Graphic3d_AspectMarker3d.hxx>
|
||||
#include <Graphic3d_MarkerImage.hxx>
|
||||
#include <Image_PixMap.hxx>
|
||||
#include <Quantity_Color.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TColStd_Array1OfByte.hxx>
|
||||
|
||||
// =======================================================================
|
||||
// function : Graphic3d_AspectMarker3d
|
||||
|
106
src/Graphic3d/Graphic3d_AspectMarker3d.hxx
Normal file
106
src/Graphic3d/Graphic3d_AspectMarker3d.hxx
Normal file
@@ -0,0 +1,106 @@
|
||||
// Created by: NW,JPB,CAL
|
||||
// Copyright (c) 1991-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 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 License 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_AspectMarker3d_HeaderFile
|
||||
#define _Graphic3d_AspectMarker3d_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Graphic3d_MarkerImage.hxx>
|
||||
#include <Graphic3d_ShaderProgram.hxx>
|
||||
#include <Aspect_AspectMarker.hxx>
|
||||
#include <Aspect_TypeOfMarker.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <TColStd_HArray1OfByte.hxx>
|
||||
#include <Image_PixMap_Handle.hxx>
|
||||
class Quantity_Color;
|
||||
|
||||
|
||||
class Graphic3d_AspectMarker3d;
|
||||
DEFINE_STANDARD_HANDLE(Graphic3d_AspectMarker3d, Aspect_AspectMarker)
|
||||
|
||||
//! Creates and updates an attribute group for
|
||||
//! marker type primitives. This group contains the type
|
||||
//! of marker, its colour, and its scale factor.
|
||||
class Graphic3d_AspectMarker3d : public Aspect_AspectMarker
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates a context table for marker primitives
|
||||
//! defined with the following default values:
|
||||
//!
|
||||
//! Marker type : TOM_X
|
||||
//! Colour : YELLOW
|
||||
//! Scale factor: 1.0
|
||||
Standard_EXPORT Graphic3d_AspectMarker3d();
|
||||
|
||||
Standard_EXPORT Graphic3d_AspectMarker3d(const Aspect_TypeOfMarker theType, const Quantity_Color& theColor, const Standard_Real theScale);
|
||||
|
||||
//! Creates a context table for marker primitives
|
||||
//! defined with the specified values.
|
||||
Standard_EXPORT Graphic3d_AspectMarker3d(const Quantity_Color& theColor, const Standard_Integer theWidth, const Standard_Integer theHeight, const Handle(TColStd_HArray1OfByte)& theTextureBitmap);
|
||||
|
||||
//! Creates a context table for marker primitives
|
||||
//! defined with the specified values.
|
||||
Standard_EXPORT Graphic3d_AspectMarker3d(const Image_PixMap_Handle& theTextureImage);
|
||||
|
||||
//! Returns marker's texture size.
|
||||
Standard_EXPORT void GetTextureSize (Standard_Integer& theWidth, Standard_Integer& theHeight) const;
|
||||
|
||||
//! Returns marker's image texture.
|
||||
//! Could be null handle if marker aspect has been initialized as
|
||||
//! default type of marker.
|
||||
Standard_EXPORT const Handle(Graphic3d_MarkerImage)& GetMarkerImage() const;
|
||||
|
||||
//! Set marker's image texture.
|
||||
Standard_EXPORT void SetMarkerImage (const Handle(Graphic3d_MarkerImage)& theImage);
|
||||
|
||||
Standard_EXPORT void SetBitMap (const Standard_Integer theWidth, const Standard_Integer theHeight, const Handle(TColStd_HArray1OfByte)& theTexture);
|
||||
|
||||
//! Sets up OpenGL/GLSL shader program.
|
||||
Standard_EXPORT void SetShaderProgram (const Handle(Graphic3d_ShaderProgram)& theProgram);
|
||||
|
||||
Standard_EXPORT const Handle(Graphic3d_ShaderProgram)& ShaderProgram() const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Graphic3d_AspectMarker3d,Aspect_AspectMarker)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
Handle(Graphic3d_MarkerImage) myMarkerImage;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Handle(Graphic3d_ShaderProgram) MyShaderProgram;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Graphic3d_AspectMarker3d_HeaderFile
|
@@ -1,298 +0,0 @@
|
||||
-- Created by: NW,JPB,CAL
|
||||
-- Copyright (c) 1991-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 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 License 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.
|
||||
|
||||
-- Modified FMN: 30-11-98 : S4069. Textes always visible.
|
||||
|
||||
class AspectText3d from Graphic3d inherits TShared
|
||||
|
||||
---Version:
|
||||
|
||||
---Purpose: Creates and updates a group of attributes for
|
||||
-- text primitives. This group contains the colour,
|
||||
-- font, expansion factor (height/width ratio), and
|
||||
-- inter-character space.
|
||||
--
|
||||
-- NOTE: The font name is stored in the aspect instance
|
||||
-- so it is safe to pass it as const char* to OpenGl package
|
||||
-- without copying the string. However, the aspect should not
|
||||
-- be deleted until the text drawn using this aspect is no longer
|
||||
-- visible. The best practice is to keep the aspect in the object's drawer.
|
||||
|
||||
uses
|
||||
|
||||
Color from Quantity,
|
||||
TypeOfStyleText from Aspect,
|
||||
TypeOfDisplayText from Aspect,
|
||||
AsciiString from TCollection,
|
||||
FontAspect from Font,
|
||||
ShaderProgram from Graphic3d
|
||||
|
||||
raises
|
||||
|
||||
AspectTextDefinitionError from Graphic3d
|
||||
|
||||
is
|
||||
|
||||
Create
|
||||
returns AspectText3d from Graphic3d;
|
||||
---Level: Public
|
||||
---Purpose: Creates a context table for text primitives
|
||||
-- defined with the following default values:
|
||||
--
|
||||
-- Colour : NOC_YELLOW
|
||||
-- Font : NOF_ASCII_MONO
|
||||
-- Expansion factor : 1.
|
||||
-- Space between characters : 0.
|
||||
-- The style : TOST_NORMAL
|
||||
-- The display type : TODT_NORMAL
|
||||
|
||||
Create ( AColor : Color from Quantity;
|
||||
AFont : CString from Standard;
|
||||
AExpansionFactor : Real from Standard;
|
||||
ASpace : Real from Standard;
|
||||
AStyle : TypeOfStyleText from Aspect = Aspect_TOST_NORMAL;
|
||||
ADisplayType : TypeOfDisplayText from Aspect = Aspect_TODT_NORMAL )
|
||||
returns AspectText3d from Graphic3d
|
||||
---Level: Public
|
||||
---Purpose: Creates a context table for text primitives
|
||||
-- defined with the specified values.
|
||||
-- AFont may be to take means from User(example "Courier New")
|
||||
-- or Font name defined in Font_NameOfFont(example Font_NOF_ASCII_MONO)
|
||||
-- or use default font("Courier")
|
||||
--
|
||||
raises AspectTextDefinitionError from Graphic3d;
|
||||
-- if <AExpansionFactor> is a negative value
|
||||
|
||||
---------------------------------------------------
|
||||
-- Category: Methods to modify the class definition
|
||||
---------------------------------------------------
|
||||
|
||||
SetColor ( me : mutable;
|
||||
AColor : Color from Quantity )
|
||||
is static;
|
||||
---Purpose: Modifies the colour of <me>.
|
||||
|
||||
SetExpansionFactor ( me : mutable;
|
||||
AFactor : Real from Standard )
|
||||
---Purpose: Modifies the expansion factor (height/width ratio)
|
||||
-- If the factor is less than 1, the characters will
|
||||
-- be higher than they are wide.
|
||||
---Category: Methods to modify the class definition
|
||||
-- Warning: Raises AspectTextDefinitionError if <AFactor> is a
|
||||
-- negative value .
|
||||
raises AspectTextDefinitionError from Graphic3d is static;
|
||||
|
||||
SetFont ( me : mutable;
|
||||
AFont : CString from Standard )
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Modifies the font of <me>.
|
||||
---Category: Methods to modify the class definition
|
||||
---AFont may be to take means from User(example "Courier New")
|
||||
---or Font name defined in Font_NameOfFont(example Font_NOF_ASCII_MONO)
|
||||
---or use default font("Courier")
|
||||
|
||||
|
||||
SetSpace ( me : mutable;
|
||||
ASpace : Real from Standard )
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Modifies the space between the characters.
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
SetStyle ( me : mutable;
|
||||
AStyle : TypeOfStyleText from Aspect )
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Modifies the style of the text.
|
||||
-- TOST_NORMAL Default text. The text is displayed like any other graphic object.
|
||||
-- This text can be hidden by another object that is nearest from the
|
||||
-- point of view.
|
||||
-- TOST_ANNOTATION The text is always visible. The texte is displayed
|
||||
-- over the other object according to the priority.
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
SetDisplayType ( me : mutable;
|
||||
ADisplayType : TypeOfDisplayText from Aspect )
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Define the display type of the text.
|
||||
--
|
||||
-- TODT_NORMAL Default display. Text only.
|
||||
-- TODT_SUBTITLE There is a subtitle under the text.
|
||||
-- TODT_DEKALE The text is displayed with a 3D style.
|
||||
-- TODT_BLEND The text is displayed in XOR.
|
||||
-- TODT_DIMENSION Dimension line under text will be invisible.
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
SetColorSubTitle ( me : mutable;
|
||||
AColor : Color from Quantity )
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Modifies the colour of the subtitle for the TODT_SUBTITLE TextDisplayType
|
||||
--- and the colour of backgroubd for the TODT_DEKALE TextDisplayType.
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
|
||||
SetTextZoomable ( me : mutable;
|
||||
AFlag : Boolean from Standard );
|
||||
---Level: Public
|
||||
---Purpose: Turns usage of text zoomable on/off
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
GetTextZoomable( me ) returns Boolean from Standard;
|
||||
---Level: Public
|
||||
---Purpose: Returns TRUE when the Text Zoomable is on.
|
||||
|
||||
SetTextAngle ( me : mutable;
|
||||
AAngle : Real from Standard );
|
||||
---Level: Public
|
||||
---Purpose: Turns usage of text rotated
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
GetTextAngle( me ) returns Real from Standard;
|
||||
---Level: Public
|
||||
---Purpose: Returns Angle of degree
|
||||
|
||||
SetTextFontAspect ( me : mutable;
|
||||
AFontAspect : FontAspect from Font );
|
||||
---Level: Public
|
||||
---Purpose: Turns usage of Aspect text
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
GetTextFontAspect( me ) returns FontAspect from Font;
|
||||
---Level: Public
|
||||
---Purpose: Returns text FontAspect
|
||||
|
||||
SetShaderProgram ( me : mutable;
|
||||
theProgram : ShaderProgram from Graphic3d );
|
||||
---Level: Public
|
||||
---Purpose: Sets up OpenGL/GLSL shader program.
|
||||
|
||||
----------------------------
|
||||
-- Category: Inquire methods
|
||||
----------------------------
|
||||
|
||||
Values ( me;
|
||||
AColor : out Color from Quantity;
|
||||
AFont : out CString from Standard;
|
||||
AnExpansionFactor : out Real from Standard;
|
||||
ASpace : out Real from Standard)
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns the current values of the group <me>.
|
||||
---Category: Inquire methods
|
||||
|
||||
|
||||
|
||||
Values ( me;
|
||||
AColor : out Color from Quantity;
|
||||
AFont : out CString from Standard;
|
||||
AnExpansionFactor : out Real from Standard;
|
||||
ASpace : out Real from Standard;
|
||||
AStyle : out TypeOfStyleText from Aspect;
|
||||
ADisplayType : out TypeOfDisplayText from Aspect;
|
||||
AColorSubTitle : out Color from Quantity
|
||||
)
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns the current values of the group <me>.
|
||||
---Category: Inquire methods
|
||||
|
||||
Values ( me;
|
||||
AColor : out Color from Quantity;
|
||||
AFont : out CString from Standard;
|
||||
AnExpansionFactor : out Real from Standard;
|
||||
ASpace : out Real from Standard;
|
||||
AStyle : out TypeOfStyleText from Aspect;
|
||||
ADisplayType : out TypeOfDisplayText from Aspect;
|
||||
AColorSubTitle : out Color from Quantity;
|
||||
ATextZoomable : out Boolean from Standard;
|
||||
ATextAngle : out Real from Standard)
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns the current values of the group <me>.
|
||||
---Category: Inquire methods
|
||||
|
||||
Values ( me;
|
||||
AColor : out Color from Quantity;
|
||||
AFont : out CString from Standard;
|
||||
AnExpansionFactor : out Real from Standard;
|
||||
ASpace : out Real from Standard;
|
||||
AStyle : out TypeOfStyleText from Aspect;
|
||||
ADisplayType : out TypeOfDisplayText from Aspect;
|
||||
AColorSubTitle : out Color from Quantity;
|
||||
ATextZoomable : out Boolean from Standard;
|
||||
ATextAngle : out Real from Standard;
|
||||
ATextFontAspect : out FontAspect from Font)
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns the current values of the group <me>.
|
||||
---Category: Inquire methods
|
||||
|
||||
ShaderProgram ( me )
|
||||
returns ShaderProgram from Graphic3d;
|
||||
---C++: return const &
|
||||
|
||||
--
|
||||
|
||||
fields
|
||||
|
||||
--
|
||||
-- Class : Graphic3d_AspectText3d
|
||||
--
|
||||
-- Purpose : Declaration of variables specific to a context for
|
||||
-- writing 3d text
|
||||
--
|
||||
-- Reminder : A text writing context is defined by:
|
||||
-- - the font
|
||||
-- - the colour
|
||||
-- - the scale
|
||||
-- - the space between characters
|
||||
--
|
||||
|
||||
-- the font utilised
|
||||
MyFont : AsciiString from TCollection;
|
||||
|
||||
-- the colour
|
||||
MyColor : Color from Quantity;
|
||||
|
||||
-- the scale
|
||||
MyFactor : Real from Standard;
|
||||
|
||||
-- the space between characters
|
||||
MySpace : Real from Standard;
|
||||
|
||||
-- the style of the text
|
||||
MyStyle : TypeOfStyleText from Aspect;
|
||||
|
||||
-- the display type of the text
|
||||
MyDisplayType : TypeOfDisplayText from Aspect;
|
||||
|
||||
-- the colour of the sub-title and background for the dekale.
|
||||
MyColorSubTitle : Color from Quantity;
|
||||
|
||||
-- the flag turning text zoomable on/off
|
||||
MyTextZoomable : Boolean from Standard;
|
||||
|
||||
-- the variable turning angle of the text
|
||||
MyTextAngle : Real from Standard;
|
||||
|
||||
-- the variable turning FontAspect of the text
|
||||
MyTextFontAspect : FontAspect from Font;
|
||||
|
||||
MyShaderProgram : ShaderProgram from Graphic3d;
|
||||
|
||||
end AspectText3d;
|
@@ -14,66 +14,46 @@
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
// 30/11/98 ; FMN : S3819. Textes always visible.
|
||||
|
||||
|
||||
//-Version
|
||||
|
||||
//-Design Declaration of variables specific to the context
|
||||
// of trace of texts 3d
|
||||
|
||||
//-Warning A context of trace of text is defined by :
|
||||
// - the font used
|
||||
// - the color
|
||||
// - the scale
|
||||
// - the space between characters
|
||||
|
||||
//-References
|
||||
|
||||
//-Language C++ 2.0
|
||||
|
||||
//-Declarations
|
||||
|
||||
// for the class
|
||||
#include <Graphic3d_AspectText3d.ixx>
|
||||
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <OSD_Environment.hxx>
|
||||
|
||||
#include <Font_NameOfFont.hxx>
|
||||
#include <Graphic3d_AspectText3d.hxx>
|
||||
#include <Graphic3d_AspectTextDefinitionError.hxx>
|
||||
#include <OSD_Environment.hxx>
|
||||
#include <Quantity_Color.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
//-Aliases
|
||||
|
||||
//-Global data definitions
|
||||
|
||||
// -- la font utilisee
|
||||
// MyFont : NameOfFont;
|
||||
|
||||
// -- la couleur
|
||||
// MyColor : Color;
|
||||
|
||||
// -- l'echelle
|
||||
// MyFactor : Standard_Real;
|
||||
|
||||
// -- l'espace entre caracteres
|
||||
// MySpace : Standard_Real;
|
||||
|
||||
// -- le style
|
||||
// MyStyle : TypeOfStyleText;
|
||||
|
||||
// -- le display type
|
||||
// MyDisplayType : TypeOfDisplayText;
|
||||
|
||||
// -- la couleur du sous-titrage et pour le fond en mode decalage.
|
||||
// MyColorSubTitle : Color;
|
||||
|
||||
//-Constructors
|
||||
|
||||
//-Destructors
|
||||
|
||||
//-Methods, in order
|
||||
|
||||
|
||||
|
||||
Graphic3d_AspectText3d::Graphic3d_AspectText3d ():
|
||||
MyFont (Font_NOF_ASCII_MONO), MyColor (Quantity_NOC_YELLOW), MyFactor (1.0), MySpace (0.0), MyStyle (Aspect_TOST_NORMAL), MyDisplayType (Aspect_TODT_NORMAL), MyColorSubTitle (Quantity_NOC_WHITE) {
|
||||
MyTextZoomable = Standard_False;
|
||||
|
177
src/Graphic3d/Graphic3d_AspectText3d.hxx
Normal file
177
src/Graphic3d/Graphic3d_AspectText3d.hxx
Normal file
@@ -0,0 +1,177 @@
|
||||
// Created by: NW,JPB,CAL
|
||||
// Copyright (c) 1991-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 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 License 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_AspectText3d_HeaderFile
|
||||
#define _Graphic3d_AspectText3d_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <Quantity_Color.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Aspect_TypeOfStyleText.hxx>
|
||||
#include <Aspect_TypeOfDisplayText.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Font_FontAspect.hxx>
|
||||
#include <Graphic3d_ShaderProgram.hxx>
|
||||
#include <MMgt_TShared.hxx>
|
||||
#include <Standard_CString.hxx>
|
||||
class Graphic3d_AspectTextDefinitionError;
|
||||
class Quantity_Color;
|
||||
|
||||
|
||||
class Graphic3d_AspectText3d;
|
||||
DEFINE_STANDARD_HANDLE(Graphic3d_AspectText3d, MMgt_TShared)
|
||||
|
||||
//! Creates and updates a group of attributes for
|
||||
//! text primitives. This group contains the colour,
|
||||
//! font, expansion factor (height/width ratio), and
|
||||
//! inter-character space.
|
||||
//!
|
||||
//! NOTE: The font name is stored in the aspect instance
|
||||
//! so it is safe to pass it as const char* to OpenGl package
|
||||
//! without copying the string. However, the aspect should not
|
||||
//! be deleted until the text drawn using this aspect is no longer
|
||||
//! visible. The best practice is to keep the aspect in the object's drawer.
|
||||
class Graphic3d_AspectText3d : public MMgt_TShared
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates a context table for text primitives
|
||||
//! defined with the following default values:
|
||||
//!
|
||||
//! Colour : NOC_YELLOW
|
||||
//! Font : NOF_ASCII_MONO
|
||||
//! Expansion factor : 1.
|
||||
//! Space between characters : 0.
|
||||
//! The style : TOST_NORMAL
|
||||
//! The display type : TODT_NORMAL
|
||||
Standard_EXPORT Graphic3d_AspectText3d();
|
||||
|
||||
//! Creates a context table for text primitives
|
||||
//! defined with the specified values.
|
||||
//! AFont may be to take means from User(example "Courier New")
|
||||
//! or Font name defined in Font_NameOfFont(example Font_NOF_ASCII_MONO)
|
||||
//! or use default font("Courier")
|
||||
Standard_EXPORT Graphic3d_AspectText3d(const Quantity_Color& AColor, const Standard_CString AFont, const Standard_Real AExpansionFactor, const Standard_Real ASpace, const Aspect_TypeOfStyleText AStyle = Aspect_TOST_NORMAL, const Aspect_TypeOfDisplayText ADisplayType = Aspect_TODT_NORMAL);
|
||||
|
||||
//! Modifies the colour of <me>.
|
||||
Standard_EXPORT void SetColor (const Quantity_Color& AColor);
|
||||
|
||||
//! Modifies the expansion factor (height/width ratio)
|
||||
//! If the factor is less than 1, the characters will
|
||||
//! be higher than they are wide.
|
||||
Standard_EXPORT void SetExpansionFactor (const Standard_Real AFactor);
|
||||
|
||||
//! Modifies the font of <me>.
|
||||
Standard_EXPORT void SetFont (const Standard_CString AFont);
|
||||
|
||||
//! Modifies the space between the characters.
|
||||
Standard_EXPORT void SetSpace (const Standard_Real ASpace);
|
||||
|
||||
//! Modifies the style of the text.
|
||||
//! TOST_NORMAL Default text. The text is displayed like any other graphic object.
|
||||
//! This text can be hidden by another object that is nearest from the
|
||||
//! point of view.
|
||||
//! TOST_ANNOTATION The text is always visible. The texte is displayed
|
||||
//! over the other object according to the priority.
|
||||
Standard_EXPORT void SetStyle (const Aspect_TypeOfStyleText AStyle);
|
||||
|
||||
//! Define the display type of the text.
|
||||
//!
|
||||
//! TODT_NORMAL Default display. Text only.
|
||||
//! TODT_SUBTITLE There is a subtitle under the text.
|
||||
//! TODT_DEKALE The text is displayed with a 3D style.
|
||||
//! TODT_BLEND The text is displayed in XOR.
|
||||
//! TODT_DIMENSION Dimension line under text will be invisible.
|
||||
Standard_EXPORT void SetDisplayType (const Aspect_TypeOfDisplayText ADisplayType);
|
||||
|
||||
//! Modifies the colour of the subtitle for the TODT_SUBTITLE TextDisplayType
|
||||
//! and the colour of backgroubd for the TODT_DEKALE TextDisplayType.
|
||||
Standard_EXPORT void SetColorSubTitle (const Quantity_Color& AColor);
|
||||
|
||||
//! Turns usage of text zoomable on/off
|
||||
Standard_EXPORT void SetTextZoomable (const Standard_Boolean AFlag);
|
||||
|
||||
//! Returns TRUE when the Text Zoomable is on.
|
||||
Standard_EXPORT Standard_Boolean GetTextZoomable() const;
|
||||
|
||||
//! Turns usage of text rotated
|
||||
Standard_EXPORT void SetTextAngle (const Standard_Real AAngle);
|
||||
|
||||
//! Returns Angle of degree
|
||||
Standard_EXPORT Standard_Real GetTextAngle() const;
|
||||
|
||||
//! Turns usage of Aspect text
|
||||
Standard_EXPORT void SetTextFontAspect (const Font_FontAspect AFontAspect);
|
||||
|
||||
//! Returns text FontAspect
|
||||
Standard_EXPORT Font_FontAspect GetTextFontAspect() const;
|
||||
|
||||
//! Sets up OpenGL/GLSL shader program.
|
||||
Standard_EXPORT void SetShaderProgram (const Handle(Graphic3d_ShaderProgram)& theProgram);
|
||||
|
||||
//! Returns the current values of the group <me>.
|
||||
Standard_EXPORT void Values (Quantity_Color& AColor, Standard_CString& AFont, Standard_Real& AnExpansionFactor, Standard_Real& ASpace) const;
|
||||
|
||||
//! Returns the current values of the group <me>.
|
||||
Standard_EXPORT void Values (Quantity_Color& AColor, Standard_CString& AFont, Standard_Real& AnExpansionFactor, Standard_Real& ASpace, Aspect_TypeOfStyleText& AStyle, Aspect_TypeOfDisplayText& ADisplayType, Quantity_Color& AColorSubTitle) const;
|
||||
|
||||
//! Returns the current values of the group <me>.
|
||||
Standard_EXPORT void Values (Quantity_Color& AColor, Standard_CString& AFont, Standard_Real& AnExpansionFactor, Standard_Real& ASpace, Aspect_TypeOfStyleText& AStyle, Aspect_TypeOfDisplayText& ADisplayType, Quantity_Color& AColorSubTitle, Standard_Boolean& ATextZoomable, Standard_Real& ATextAngle) const;
|
||||
|
||||
//! Returns the current values of the group <me>.
|
||||
Standard_EXPORT void Values (Quantity_Color& AColor, Standard_CString& AFont, Standard_Real& AnExpansionFactor, Standard_Real& ASpace, Aspect_TypeOfStyleText& AStyle, Aspect_TypeOfDisplayText& ADisplayType, Quantity_Color& AColorSubTitle, Standard_Boolean& ATextZoomable, Standard_Real& ATextAngle, Font_FontAspect& ATextFontAspect) const;
|
||||
|
||||
Standard_EXPORT const Handle(Graphic3d_ShaderProgram)& ShaderProgram() const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Graphic3d_AspectText3d,MMgt_TShared)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
TCollection_AsciiString MyFont;
|
||||
Quantity_Color MyColor;
|
||||
Standard_Real MyFactor;
|
||||
Standard_Real MySpace;
|
||||
Aspect_TypeOfStyleText MyStyle;
|
||||
Aspect_TypeOfDisplayText MyDisplayType;
|
||||
Quantity_Color MyColorSubTitle;
|
||||
Standard_Boolean MyTextZoomable;
|
||||
Standard_Real MyTextAngle;
|
||||
Font_FontAspect MyTextFontAspect;
|
||||
Handle(Graphic3d_ShaderProgram) MyShaderProgram;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Graphic3d_AspectText3d_HeaderFile
|
37
src/Graphic3d/Graphic3d_AspectTextDefinitionError.hxx
Normal file
37
src/Graphic3d/Graphic3d_AspectTextDefinitionError.hxx
Normal file
@@ -0,0 +1,37 @@
|
||||
// Created on: 1993-03-31
|
||||
// Created by: NW,JPB,CAL
|
||||
// Copyright (c) 1993-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 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 License 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_AspectTextDefinitionError_HeaderFile
|
||||
#define _Graphic3d_AspectTextDefinitionError_HeaderFile
|
||||
|
||||
#include <Standard_Type.hxx>
|
||||
#include <Standard_DefineException.hxx>
|
||||
#include <Standard_SStream.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
|
||||
class Graphic3d_AspectTextDefinitionError;
|
||||
DEFINE_STANDARD_HANDLE(Graphic3d_AspectTextDefinitionError, Standard_OutOfRange)
|
||||
|
||||
#if !defined No_Exception && !defined No_Graphic3d_AspectTextDefinitionError
|
||||
#define Graphic3d_AspectTextDefinitionError_Raise_if(CONDITION, MESSAGE) \
|
||||
if (CONDITION) Graphic3d_AspectTextDefinitionError::Raise(MESSAGE);
|
||||
#else
|
||||
#define Graphic3d_AspectTextDefinitionError_Raise_if(CONDITION, MESSAGE)
|
||||
#endif
|
||||
|
||||
DEFINE_STANDARD_EXCEPTION(Graphic3d_AspectTextDefinitionError, Standard_OutOfRange)
|
||||
|
||||
#endif // _Graphic3d_AspectTextDefinitionError_HeaderFile
|
@@ -1,27 +0,0 @@
|
||||
-- Created on: 1996-10-03
|
||||
-- Created by: Jean GAUTIER
|
||||
-- Copyright (c) 1996-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 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 License 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.
|
||||
|
||||
-- 01-11-97 : BGN : Portage HP/OpenGL
|
||||
-- => mise en coherence des options de compilations.
|
||||
|
||||
@ifnotdefined ( %Graphic3d_CMPLRS_EDL) then
|
||||
@set %Graphic3d_CMPLRS_EDL = "";
|
||||
@uses "CSF.edl";
|
||||
|
||||
--@uses "Graphic3d.edl";
|
||||
@string %CMPLRS_CXX_Options = %CMPLRS_CXX_Options " " %CSF_X11_INCLUDE ;
|
||||
|
||||
@endif;
|
23
src/Graphic3d/Graphic3d_CStructurePtr.hxx
Normal file
23
src/Graphic3d/Graphic3d_CStructurePtr.hxx
Normal file
@@ -0,0 +1,23 @@
|
||||
// Created on: 1993-03-31
|
||||
// Created by: NW,JPB,CAL
|
||||
// Copyright (c) 1993-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 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 License 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_CStructurePtr_HeaderFile
|
||||
#define _Graphic3d_CStructurePtr_HeaderFile
|
||||
|
||||
class Graphic3d_CStructure;
|
||||
typedef Graphic3d_CStructure* Graphic3d_CStructurePtr;
|
||||
|
||||
#endif // _Graphic3d_CStructurePtr_HeaderFile
|
37
src/Graphic3d/Graphic3d_CycleError.hxx
Normal file
37
src/Graphic3d/Graphic3d_CycleError.hxx
Normal file
@@ -0,0 +1,37 @@
|
||||
// Created on: 1993-03-31
|
||||
// Created by: NW,JPB,CAL
|
||||
// Copyright (c) 1993-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 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 License 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_CycleError_HeaderFile
|
||||
#define _Graphic3d_CycleError_HeaderFile
|
||||
|
||||
#include <Standard_Type.hxx>
|
||||
#include <Standard_DefineException.hxx>
|
||||
#include <Standard_SStream.hxx>
|
||||
#include <Standard_DomainError.hxx>
|
||||
|
||||
class Graphic3d_CycleError;
|
||||
DEFINE_STANDARD_HANDLE(Graphic3d_CycleError, Standard_DomainError)
|
||||
|
||||
#if !defined No_Exception && !defined No_Graphic3d_CycleError
|
||||
#define Graphic3d_CycleError_Raise_if(CONDITION, MESSAGE) \
|
||||
if (CONDITION) Graphic3d_CycleError::Raise(MESSAGE);
|
||||
#else
|
||||
#define Graphic3d_CycleError_Raise_if(CONDITION, MESSAGE)
|
||||
#endif
|
||||
|
||||
DEFINE_STANDARD_EXCEPTION(Graphic3d_CycleError, Standard_DomainError)
|
||||
|
||||
#endif // _Graphic3d_CycleError_HeaderFile
|
@@ -1,53 +0,0 @@
|
||||
-- Created by: CAL
|
||||
-- Copyright (c) 1995-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 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 License 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.
|
||||
|
||||
-- 11/97 ; CAL : retrait des DataStructure
|
||||
|
||||
deferred class DataStructureManager from Graphic3d inherits TShared
|
||||
|
||||
---Version:
|
||||
|
||||
---Purpose: This class allows the definition of a manager to
|
||||
-- which the graphic objects are associated.
|
||||
-- It allows them to be globally manipulated.
|
||||
-- It defines the global attributes.
|
||||
|
||||
---Keywords:
|
||||
|
||||
---Warning:
|
||||
---References:
|
||||
|
||||
is
|
||||
-------------------------
|
||||
-- Category: Constructors
|
||||
-------------------------
|
||||
|
||||
Initialize;
|
||||
---Level: Public
|
||||
---Purpose: Initializes the manager <me>.
|
||||
---Category: Constructors
|
||||
|
||||
------------------------
|
||||
-- Category: Destructors
|
||||
------------------------
|
||||
|
||||
Destroy (me: mutable)
|
||||
is virtual;
|
||||
---Level: Public
|
||||
---Purpose: Deletes the manager <me>.
|
||||
---C++: alias ~
|
||||
---Category: Destructors
|
||||
|
||||
end DataStructureManager from Graphic3d;
|
@@ -14,29 +14,20 @@
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
// 11/97 ; CAL : retrait des DataStructure
|
||||
|
||||
|
||||
//-Version
|
||||
|
||||
//-Design
|
||||
|
||||
//-Warning
|
||||
|
||||
//-References
|
||||
|
||||
//-Language C++ 2.0
|
||||
|
||||
//-Declarations
|
||||
|
||||
// for the class
|
||||
#include <Graphic3d_DataStructureManager.ixx>
|
||||
|
||||
#include <Graphic3d_DataStructureManager.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
//-Aliases
|
||||
|
||||
//-Global data definitions
|
||||
|
||||
//-Constructors
|
||||
|
||||
Graphic3d_DataStructureManager::Graphic3d_DataStructureManager () {
|
||||
}
|
||||
|
||||
|
70
src/Graphic3d/Graphic3d_DataStructureManager.hxx
Normal file
70
src/Graphic3d/Graphic3d_DataStructureManager.hxx
Normal file
@@ -0,0 +1,70 @@
|
||||
// Created by: CAL
|
||||
// Copyright (c) 1995-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 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 License 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_DataStructureManager_HeaderFile
|
||||
#define _Graphic3d_DataStructureManager_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <MMgt_TShared.hxx>
|
||||
|
||||
|
||||
class Graphic3d_DataStructureManager;
|
||||
DEFINE_STANDARD_HANDLE(Graphic3d_DataStructureManager, MMgt_TShared)
|
||||
|
||||
//! This class allows the definition of a manager to
|
||||
//! which the graphic objects are associated.
|
||||
//! It allows them to be globally manipulated.
|
||||
//! It defines the global attributes.
|
||||
class Graphic3d_DataStructureManager : public MMgt_TShared
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Deletes the manager <me>.
|
||||
Standard_EXPORT virtual void Destroy();
|
||||
~Graphic3d_DataStructureManager()
|
||||
{
|
||||
Destroy();
|
||||
}
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Graphic3d_DataStructureManager,MMgt_TShared)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
//! Initializes the manager <me>.
|
||||
Standard_EXPORT Graphic3d_DataStructureManager();
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Graphic3d_DataStructureManager_HeaderFile
|
32
src/Graphic3d/Graphic3d_ExportFormat.hxx
Normal file
32
src/Graphic3d/Graphic3d_ExportFormat.hxx
Normal file
@@ -0,0 +1,32 @@
|
||||
// Created on: 1993-03-31
|
||||
// Created by: NW,JPB,CAL
|
||||
// Copyright (c) 1993-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 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 License 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_ExportFormat_HeaderFile
|
||||
#define _Graphic3d_ExportFormat_HeaderFile
|
||||
|
||||
|
||||
enum Graphic3d_ExportFormat
|
||||
{
|
||||
Graphic3d_EF_PostScript,
|
||||
Graphic3d_EF_EnhPostScript,
|
||||
Graphic3d_EF_TEX,
|
||||
Graphic3d_EF_PDF,
|
||||
Graphic3d_EF_SVG,
|
||||
Graphic3d_EF_PGF,
|
||||
Graphic3d_EF_EMF
|
||||
};
|
||||
|
||||
#endif // _Graphic3d_ExportFormat_HeaderFile
|
@@ -1,733 +0,0 @@
|
||||
-- Created on: 1997-01-28
|
||||
-- Created by: CAL
|
||||
-- Copyright (c) 1997-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 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 License 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.
|
||||
|
||||
deferred class GraphicDriver from Graphic3d inherits TShared
|
||||
|
||||
---Version:
|
||||
|
||||
---Purpose: This class allows the definition of a graphic driver
|
||||
-- for 3d interface (currently only OpenGl driver is used).
|
||||
|
||||
---Keywords: OpenGl
|
||||
|
||||
---Warning:
|
||||
---References:
|
||||
|
||||
uses
|
||||
|
||||
Array1OfInteger from TColStd,
|
||||
Array1OfReal from TColStd,
|
||||
Array2OfReal from TColStd,
|
||||
|
||||
AsciiString from TCollection,
|
||||
ExtendedString from TCollection,
|
||||
|
||||
NameOfColor from Quantity,
|
||||
Color from Quantity,
|
||||
|
||||
PlaneAngle from Quantity,
|
||||
|
||||
PixMap from Image,
|
||||
|
||||
CLayer2d from Aspect,
|
||||
TypeOfTriedronEcho from Aspect,
|
||||
TypeOfTriedronPosition from Aspect,
|
||||
Handle from Aspect,
|
||||
Display from Aspect,
|
||||
PrintAlgo from Aspect,
|
||||
DisplayConnection from Aspect,
|
||||
|
||||
ZLayerId from Graphic3d,
|
||||
ZLayerSettings from Graphic3d,
|
||||
|
||||
AspectLine3d from Graphic3d,
|
||||
AspectMarker3d from Graphic3d,
|
||||
AspectText3d from Graphic3d,
|
||||
AspectFillArea3d from Graphic3d,
|
||||
HorizontalTextAlignment from Graphic3d,
|
||||
CBitFields20 from Graphic3d,
|
||||
Group from Graphic3d,
|
||||
CLight from Graphic3d,
|
||||
CPlane from Graphic3d,
|
||||
CStructure from Graphic3d,
|
||||
CView from Graphic3d,
|
||||
BufferType from Graphic3d,
|
||||
Structure from Graphic3d,
|
||||
StructureManager from Graphic3d,
|
||||
TextPath from Graphic3d,
|
||||
TypeOfComposition from Graphic3d,
|
||||
TypeOfPrimitive from Graphic3d,
|
||||
Vector from Graphic3d,
|
||||
Array1OfVertex from Graphic3d,
|
||||
Array2OfVertex from Graphic3d,
|
||||
Vertex from Graphic3d,
|
||||
VerticalTextAlignment from Graphic3d,
|
||||
PtrFrameBuffer from Graphic3d,
|
||||
HArray1OfByte from TColStd,
|
||||
FillMethod from Aspect,
|
||||
GradientFillMethod from Aspect,
|
||||
ExportFormat from Graphic3d,
|
||||
SortType from Graphic3d,
|
||||
HArray1OfReal from TColStd,
|
||||
CUserDraw from Graphic3d,
|
||||
NListOfHAsciiString from Graphic3d,
|
||||
FontAspect from Font,
|
||||
GraduatedTrihedron from Graphic3d,
|
||||
ClipPlane from Graphic3d,
|
||||
Vec3 from Graphic3d,
|
||||
Ax2 from gp
|
||||
|
||||
raises
|
||||
|
||||
TransformError from Graphic3d
|
||||
|
||||
is
|
||||
Initialize (theDisp : DisplayConnection from Aspect)
|
||||
returns GraphicDriver from Graphic3d;
|
||||
---Level: Public
|
||||
---Purpose: Initialises the Driver
|
||||
|
||||
----------------------------
|
||||
-- Category: Inquire methods
|
||||
----------------------------
|
||||
|
||||
InquireLightLimit ( me : mutable )
|
||||
returns Integer from Standard
|
||||
is deferred;
|
||||
---Purpose: call_togl_inquirelight
|
||||
|
||||
InquirePlaneLimit ( me : mutable )
|
||||
returns Integer from Standard
|
||||
is deferred;
|
||||
---Purpose: call_togl_inquireplane
|
||||
|
||||
InquireViewLimit ( me : mutable )
|
||||
returns Integer from Standard
|
||||
is deferred;
|
||||
---Purpose: call_togl_inquireview
|
||||
|
||||
-----------------------------------------
|
||||
-- Category: Structure management methods
|
||||
-----------------------------------------
|
||||
|
||||
DisplayStructure ( me : mutable;
|
||||
theCView : CView from Graphic3d;
|
||||
theStructure : Structure from Graphic3d;
|
||||
thePriority : Integer from Standard )
|
||||
is deferred;
|
||||
---Purpose: call_togl_displaystructure
|
||||
|
||||
EraseStructure ( me : mutable;
|
||||
theCView : CView from Graphic3d;
|
||||
theStructure : Structure from Graphic3d )
|
||||
is deferred;
|
||||
---Purpose: call_togl_erasestructure
|
||||
|
||||
RemoveStructure ( me : mutable;
|
||||
theCStructure : in out CStructure from Graphic3d )
|
||||
is deferred;
|
||||
---Purpose: call_togl_removestructure
|
||||
|
||||
Structure (me : mutable;
|
||||
theManager : StructureManager from Graphic3d)
|
||||
returns CStructure from Graphic3d
|
||||
is deferred;
|
||||
---Purpose: Creates new empty graphic structure
|
||||
|
||||
------------------------------------
|
||||
-- Category: Structured mode methods
|
||||
------------------------------------
|
||||
|
||||
ActivateView ( me : mutable;
|
||||
ACView : CView from Graphic3d )
|
||||
is deferred;
|
||||
---Purpose: call_togl_activateview
|
||||
|
||||
AntiAliasing ( me : mutable;
|
||||
ACView : CView from Graphic3d;
|
||||
AFlag : Boolean from Standard )
|
||||
is deferred;
|
||||
---Purpose: call_togl_antialiasing
|
||||
|
||||
Background ( me : mutable;
|
||||
ACView : CView from Graphic3d )
|
||||
is deferred;
|
||||
---Purpose: call_togl_background
|
||||
|
||||
GradientBackground ( me : mutable;
|
||||
ACView : CView from Graphic3d;
|
||||
AColor1: Color from Quantity;
|
||||
AColor2: Color from Quantity;
|
||||
FillStyle : GradientFillMethod from Aspect
|
||||
)
|
||||
is deferred;
|
||||
---Purpose: call_togl_gradient_background
|
||||
|
||||
|
||||
BackgroundImage( me : mutable;
|
||||
FileName : CString from Standard;
|
||||
ACView : CView from Graphic3d;
|
||||
FillStyle : FillMethod from Aspect )
|
||||
is deferred;
|
||||
|
||||
SetBgImageStyle( me : mutable;
|
||||
ACView : CView from Graphic3d;
|
||||
FillStyle : FillMethod from Aspect )
|
||||
is deferred;
|
||||
|
||||
SetBgGradientStyle( me : mutable;
|
||||
ACView : CView from Graphic3d;
|
||||
FillStyle : GradientFillMethod from Aspect )
|
||||
is deferred;
|
||||
|
||||
ClipLimit ( me : mutable;
|
||||
ACView : CView from Graphic3d;
|
||||
AWait : Boolean from Standard )
|
||||
is deferred;
|
||||
---Purpose: call_togl_cliplimit
|
||||
|
||||
DeactivateView ( me : mutable;
|
||||
ACView : CView from Graphic3d )
|
||||
is deferred;
|
||||
---Purpose: call_togl_deactivateview
|
||||
|
||||
DepthCueing ( me : mutable;
|
||||
ACView : CView from Graphic3d;
|
||||
AFlag : Boolean from Standard )
|
||||
is deferred;
|
||||
---Purpose: call_togl_cliplimit
|
||||
|
||||
RatioWindow ( me : mutable;
|
||||
ACView : CView from Graphic3d )
|
||||
is deferred;
|
||||
---Purpose: call_togl_ratio_window
|
||||
|
||||
Redraw ( me : mutable;
|
||||
theCView : CView from Graphic3d;
|
||||
theCUnderLayer : CLayer2d from Aspect;
|
||||
theCOverLayer : CLayer2d from Aspect;
|
||||
theX : Integer = 0;
|
||||
theY : Integer = 0;
|
||||
theWidth : Integer = 0;
|
||||
theHeight : Integer = 0 )
|
||||
is deferred;
|
||||
---Purpose: Redraw content of the view
|
||||
|
||||
RedrawImmediate ( me : mutable;
|
||||
theCView : CView from Graphic3d;
|
||||
theCUnderLayer : CLayer2d from Aspect;
|
||||
theCOverLayer : CLayer2d from Aspect )
|
||||
is deferred;
|
||||
---Purpose: Redraw layer of immediate presentations
|
||||
|
||||
Invalidate ( me : mutable;
|
||||
theCView : CView from Graphic3d )
|
||||
is deferred;
|
||||
---Purpose: Invalidates content of the view but does not redraw it
|
||||
|
||||
RemoveView ( me : mutable;
|
||||
ACView : CView from Graphic3d )
|
||||
is deferred;
|
||||
---Purpose: call_togl_removeview
|
||||
|
||||
SetLight ( me : mutable;
|
||||
ACView : CView from Graphic3d )
|
||||
is deferred;
|
||||
---Purpose: call_togl_setlight
|
||||
|
||||
SetClipPlanes (me : mutable; theCView : CView from Graphic3d) is deferred;
|
||||
---Purpose: Pass clip planes to the associated graphic driver view.
|
||||
|
||||
SetCamera (me : mutable; theCView : CView from Graphic3d)
|
||||
is deferred;
|
||||
---Purpose: Inform graphic driver if camera assigned to view changes.
|
||||
|
||||
SetVisualisation ( me : mutable;
|
||||
ACView : CView from Graphic3d )
|
||||
is deferred;
|
||||
---Purpose: call_togl_setvisualisation
|
||||
|
||||
View ( me : mutable;
|
||||
ACView : in out CView from Graphic3d )
|
||||
returns Boolean from Standard
|
||||
is deferred;
|
||||
---Purpose: call_togl_view
|
||||
|
||||
Environment ( me : mutable;
|
||||
ACView : CView from Graphic3d )
|
||||
is deferred;
|
||||
---Purpose:
|
||||
|
||||
----------------------------------------
|
||||
---Category: Methods to create Triangle
|
||||
-- for Purpose : see Graphic3d_Group.cdl
|
||||
----------------------------------------
|
||||
|
||||
EnableVBO( me : mutable;
|
||||
status : Boolean from Standard )
|
||||
is deferred;
|
||||
---Purpose: enables/disables usage of OpenGL vertex buffer arrays while drawing primitiev arrays
|
||||
|
||||
MemoryInfo (me;
|
||||
theFreeBytes : out Size from Standard;
|
||||
theInfo : out AsciiString from TCollection) returns Boolean from Standard is deferred;
|
||||
---Purpose: Returns information about GPU memory usage.
|
||||
|
||||
----------------------------------------
|
||||
---Category: Methods to create Triedron
|
||||
-- for Purpose : see Graphic3d_Group.cdl
|
||||
----------------------------------------
|
||||
|
||||
ZBufferTriedronSetup ( me : mutable;
|
||||
theCView : CView from Graphic3d;
|
||||
XColor : NameOfColor from Quantity = Quantity_NOC_RED;
|
||||
YColor : NameOfColor from Quantity = Quantity_NOC_GREEN;
|
||||
ZColor : NameOfColor from Quantity = Quantity_NOC_BLUE1;
|
||||
SizeRatio : Real from Standard = 0.8;
|
||||
AxisDiametr : Real from Standard = 0.05;
|
||||
NbFacettes : Integer from Standard = 12)
|
||||
is deferred;
|
||||
---Purpose: call_togl_ztriedron_setup
|
||||
|
||||
TriedronDisplay ( me : mutable;
|
||||
ACView : CView from Graphic3d;
|
||||
APosition : TypeOfTriedronPosition from Aspect = Aspect_TOTP_CENTER;
|
||||
AColor : NameOfColor from Quantity = Quantity_NOC_WHITE ;
|
||||
AScale : Real from Standard = 0.02;
|
||||
AsWireframe : Boolean from Standard = Standard_True )
|
||||
is deferred;
|
||||
---Purpose: call_togl_triedron_display
|
||||
|
||||
|
||||
TriedronErase ( me : mutable;
|
||||
ACView : CView from Graphic3d)
|
||||
is deferred;
|
||||
---Purpose: call_togl_triedron_erase
|
||||
|
||||
|
||||
TriedronEcho ( me : mutable;
|
||||
ACView : CView from Graphic3d;
|
||||
AType : TypeOfTriedronEcho from Aspect = Aspect_TOTE_NONE )
|
||||
is deferred;
|
||||
---Purpose: call_togl_triedron_echo
|
||||
|
||||
---------------------------------
|
||||
---Category: Graduated trihedron
|
||||
---------------------------------
|
||||
|
||||
GraduatedTrihedronDisplay(me : mutable;
|
||||
theView : CView from Graphic3d;
|
||||
theCubic : GraduatedTrihedron from Graphic3d)
|
||||
---Purpose: call_togl_graduatedtrihedron_display
|
||||
is deferred;
|
||||
|
||||
GraduatedTrihedronErase(me : mutable;
|
||||
theView : CView from Graphic3d)
|
||||
---Purpose: call_togl_graduatedtrihedron_erase
|
||||
is deferred;
|
||||
|
||||
GraduatedTrihedronMinMaxValues (me : mutable;
|
||||
theView : CView from Graphic3d;
|
||||
theMin : Vec3 from Graphic3d;
|
||||
theMax : Vec3 from Graphic3d)
|
||||
---Purpose: Sets minimum and maximum points of scene bounding box for Graduated Trihedron
|
||||
-- stored in graphic view object.
|
||||
-- @param theView [in] current graphic view
|
||||
-- @param theMin [in] the minimum point of scene.
|
||||
-- @param theMax [in] the maximum point of scene.
|
||||
|
||||
is deferred;
|
||||
|
||||
----------------------------------
|
||||
-- Category: Immediate mode methods
|
||||
----------------------------------
|
||||
|
||||
SetImmediateModeDrawToFront (me : mutable;
|
||||
theCView : CView from Graphic3d;
|
||||
theDrawToFrontBuffer : Boolean from Standard)
|
||||
returns Boolean from Standard
|
||||
is deferred;
|
||||
---Purpose: @param theDrawToFrontBuffer Advanced option to modify rendering mode:
|
||||
-- 1. TRUE. Drawing immediate mode structures directly to the front buffer over the scene image.
|
||||
-- Fast, so preferred for interactive work (used by default).
|
||||
-- However these extra drawings will be missed in image dump since it is performed from back buffer.
|
||||
-- Notice that since no pre-buffering used the V-Sync will be ignored and rendering could be seen
|
||||
-- in run-time (in case of slow hardware) and/or tearing may appear.
|
||||
-- So this is strongly recommended to draw only simple (fast) structures.
|
||||
-- 2. FALSE. Drawing immediate mode structures to the back buffer.
|
||||
-- The complete scene is redrawn first, so this mode is slower if scene contains complex data and/or V-Sync is turned on.
|
||||
-- But it works in any case and is especially useful for view dump because the dump image is read from the back buffer.
|
||||
-- @return previous mode.
|
||||
|
||||
DisplayImmediateStructure ( me : mutable;
|
||||
theCView : CView from Graphic3d;
|
||||
theStructure : Structure from Graphic3d )
|
||||
is deferred;
|
||||
---Purpose: Display structure in immediate mode on top of general presentation
|
||||
|
||||
---C++: alias "
|
||||
//! Erases immediate structure
|
||||
Standard_EXPORT virtual void EraseImmediateStructure (const Graphic3d_CView& theCView, const Graphic3d_CStructure& theCStructure) = 0;"
|
||||
|
||||
-------------------------------
|
||||
-- Category: Layer mode methods
|
||||
-------------------------------
|
||||
|
||||
Layer ( me : mutable;
|
||||
ACLayer : in out CLayer2d from Aspect )
|
||||
is deferred;
|
||||
---Purpose: call_togl_layer2d
|
||||
|
||||
RemoveLayer ( me : mutable;
|
||||
ACLayer : CLayer2d from Aspect )
|
||||
is deferred;
|
||||
---Purpose: call_togl_removelayer2d
|
||||
|
||||
BeginLayer ( me : mutable;
|
||||
ACLayer : CLayer2d from Aspect )
|
||||
is deferred;
|
||||
---Purpose: call_togl_begin_layer2d
|
||||
|
||||
BeginPolygon2d ( me : mutable )
|
||||
is deferred;
|
||||
---Purpose: call_togl_begin_polygon2d
|
||||
|
||||
BeginPolyline2d ( me : mutable )
|
||||
is deferred;
|
||||
---Purpose: call_togl_begin_polyline2d
|
||||
|
||||
ClearLayer ( me : mutable;
|
||||
ACLayer : CLayer2d from Aspect )
|
||||
is deferred;
|
||||
---Purpose: call_togl_clear_layer2d
|
||||
|
||||
Draw ( me : mutable;
|
||||
X : ShortReal from Standard;
|
||||
Y : ShortReal from Standard )
|
||||
is deferred;
|
||||
---Purpose: call_togl_draw2d
|
||||
|
||||
Edge ( me : mutable;
|
||||
X : ShortReal from Standard;
|
||||
Y : ShortReal from Standard )
|
||||
is deferred;
|
||||
---Purpose: call_togl_edge2d
|
||||
|
||||
EndLayer ( me : mutable )
|
||||
is deferred;
|
||||
---Purpose: call_togl_end_layer2d
|
||||
|
||||
EndPolygon2d ( me : mutable )
|
||||
is deferred;
|
||||
---Purpose: call_togl_end_polygon2d
|
||||
|
||||
EndPolyline2d ( me : mutable )
|
||||
is deferred;
|
||||
---Purpose: call_togl_end_polyline2d
|
||||
|
||||
Move ( me : mutable;
|
||||
X : ShortReal from Standard;
|
||||
Y : ShortReal from Standard )
|
||||
is deferred;
|
||||
---Purpose: call_togl_move2d
|
||||
|
||||
Rectangle ( me : mutable;
|
||||
X, Y : ShortReal from Standard;
|
||||
Width, Height : ShortReal from Standard )
|
||||
is deferred;
|
||||
---Purpose: call_togl_rectangle2d
|
||||
|
||||
SetColor ( me : mutable;
|
||||
R : ShortReal from Standard;
|
||||
G : ShortReal from Standard;
|
||||
B : ShortReal from Standard )
|
||||
is deferred;
|
||||
---Purpose: call_togl_set_color
|
||||
|
||||
SetTransparency ( me : mutable;
|
||||
ATransparency : ShortReal from Standard )
|
||||
is deferred;
|
||||
---Purpose: call_togl_set_transparency
|
||||
|
||||
UnsetTransparency ( me : mutable )
|
||||
is deferred;
|
||||
---Purpose: call_togl_unset_transparency
|
||||
|
||||
SetLineAttributes ( me : mutable;
|
||||
Type : Integer from Standard;
|
||||
Width : ShortReal from Standard )
|
||||
is deferred;
|
||||
---Purpose: call_togl_set_line_attributes
|
||||
|
||||
|
||||
SetTextAttributes ( me : mutable;
|
||||
Font : CString from Standard;
|
||||
Type : Integer from Standard;
|
||||
R : ShortReal from Standard;
|
||||
G : ShortReal from Standard;
|
||||
B : ShortReal from Standard )
|
||||
is deferred;
|
||||
---Purpose: Set text attributes for under-/overlayer.
|
||||
-- <Font> argument defines the name of the font to be used,
|
||||
-- <Type> argument defines the display type of the text,
|
||||
-- <R> <G> <B> values define the color of decal or subtitle background.
|
||||
-- To set the color of the text you can use the SetColor method.
|
||||
|
||||
Text ( me : mutable;
|
||||
AText : CString from Standard;
|
||||
X, Y : ShortReal from Standard;
|
||||
AHeight : ShortReal from Standard )
|
||||
is deferred;
|
||||
---Purpose: call_togl_text2d
|
||||
-- If AHeight < 0 default text height is used by driver (DefaultTextHeight method)
|
||||
|
||||
DefaultTextHeight( me )
|
||||
returns ShortReal from Standard
|
||||
is deferred;
|
||||
|
||||
|
||||
TextSize( me;
|
||||
AText : CString from Standard;
|
||||
AHeight : ShortReal from Standard;
|
||||
AWidth : in out ShortReal from Standard;
|
||||
AnAscent : in out ShortReal from Standard;
|
||||
ADescent : in out ShortReal from Standard )
|
||||
is deferred;
|
||||
---Purpose: call_togl_textsize2d
|
||||
|
||||
SetBackFacingModel ( me : mutable;
|
||||
aView : CView from Graphic3d )
|
||||
is deferred;
|
||||
---Purpose: call_togl_backfacing
|
||||
|
||||
ReadDepths( me;
|
||||
view : CView from Graphic3d;
|
||||
x, y : Integer;
|
||||
width, height : Integer;
|
||||
buffer : Address )
|
||||
is deferred;
|
||||
---Purpose: Reads depths of shown pixels of the given
|
||||
-- rectangle (glReadPixels with GL_DEPTH_COMPONENT)
|
||||
|
||||
FBOCreate( me : mutable;
|
||||
view : CView from Graphic3d;
|
||||
width, height : Integer from Standard )
|
||||
returns PtrFrameBuffer from Graphic3d
|
||||
is deferred;
|
||||
---Purpose: Generate offscreen FBO in the graphic library.
|
||||
-- If not supported on hardware returns NULL.
|
||||
|
||||
FBORelease( me : mutable;
|
||||
view : CView from Graphic3d;
|
||||
fboPtr : in out PtrFrameBuffer from Graphic3d )
|
||||
is deferred;
|
||||
---Purpose: Remove offscreen FBO from the graphic library
|
||||
|
||||
FBOGetDimensions( me : mutable;
|
||||
view : CView from Graphic3d;
|
||||
fboPtr : PtrFrameBuffer from Graphic3d;
|
||||
width, height : out Integer from Standard;
|
||||
widthMax, heightMax : out Integer from Standard )
|
||||
is deferred;
|
||||
---Purpose: Read offscreen FBO configuration.
|
||||
|
||||
FBOChangeViewport( me : mutable;
|
||||
view : CView from Graphic3d;
|
||||
fboPtr : in out PtrFrameBuffer from Graphic3d;
|
||||
width, height : Integer from Standard )
|
||||
is deferred;
|
||||
---Purpose: Change offscreen FBO viewport.
|
||||
|
||||
BufferDump( me : mutable;
|
||||
theCView : CView from Graphic3d;
|
||||
theImage : in out PixMap from Image;
|
||||
theBufferType : BufferType from Graphic3d )
|
||||
returns Boolean from Standard
|
||||
is deferred;
|
||||
---Purpose: Dump active rendering buffer into specified memory buffer.
|
||||
|
||||
SetGLLightEnabled( me; view : CView from Graphic3d;
|
||||
isEnabled : Boolean from Standard )
|
||||
is deferred;
|
||||
---Purpose: call_togl_gllight
|
||||
|
||||
IsGLLightEnabled( me; view : CView from Graphic3d )
|
||||
returns Boolean from Standard is deferred;
|
||||
---Purpose: call_togl_isgllight
|
||||
|
||||
Print (me;
|
||||
ACView : CView from Graphic3d;
|
||||
ACUnderLayer : CLayer2d from Aspect;
|
||||
ACOverLayer : CLayer2d from Aspect;
|
||||
hPrnDC : Handle from Aspect;
|
||||
showBackground : Boolean;
|
||||
filename : CString;
|
||||
printAlgorithm : PrintAlgo from Aspect = Aspect_PA_STRETCH;
|
||||
theScaleFactor : Real from Standard = 1.0 )
|
||||
returns Boolean from Standard is deferred;
|
||||
---Level: Internal
|
||||
---Purpose: print the contents of all layers of the view to the printer.
|
||||
-- <hPrnDC> : Pass the PrinterDeviceContext (HDC),
|
||||
-- <showBackground> : When set to FALSE then print the view without background color
|
||||
-- (background is white)
|
||||
-- else set to TRUE for printing with current background color.
|
||||
-- <filename>: If != NULL, then the view will be printed to a file.
|
||||
-- <printAlgorithm>: Select print algorithm: stretch, tile.
|
||||
-- <theScaleFactor>: Scaling coefficient, used internally to scale the
|
||||
-- printings accordingly to the scale factor selected in the printer
|
||||
-- properties dialog.
|
||||
-- Returns Standard_True if the data is passed to the printer, otherwise
|
||||
-- Standard_False if the print operation failed due to the printer errors,
|
||||
-- or insufficient system memory available.
|
||||
---Warning: Works only under Windows.
|
||||
|
||||
Export( me: mutable;
|
||||
theFileName : CString from Standard;
|
||||
theFormat : ExportFormat from Graphic3d;
|
||||
theSortType : SortType from Graphic3d;
|
||||
theWidth, theHeight : Integer from Standard;
|
||||
theView : CView from Graphic3d;
|
||||
theLayerUnder : CLayer2d from Aspect;
|
||||
theLayerOver : CLayer2d from Aspect;
|
||||
thePrecision : Real from Standard = 0.005;
|
||||
theProgressBarFunc : Address from Standard = NULL;
|
||||
theProgressObject : Address from Standard = NULL )
|
||||
returns Boolean from Standard
|
||||
is deferred;
|
||||
---Purpose:
|
||||
-- Export scene into the one of the Vector graphics formats (SVG, PS, PDF...).
|
||||
-- In contrast to Bitmaps, Vector graphics is scalable (so you may got quality benefits on printing to laser printer).
|
||||
-- Notice however that results may differ a lot and do not contain some elements.
|
||||
|
||||
InvalidateBVHData( me : mutable;
|
||||
theCView : out CView from Graphic3d;
|
||||
theLayerId : Integer from Standard )
|
||||
is deferred;
|
||||
---Purpose:
|
||||
-- Marks BVH tree and the set of BVH primitives of correspondent priority list with id theLayerId as outdated.
|
||||
|
||||
AddZLayer( me : mutable;
|
||||
theCView : CView from Graphic3d;
|
||||
theLayerId : ZLayerId from Graphic3d )
|
||||
is deferred;
|
||||
---Purpose: Add a new top-level z layer with ID <theLayerId> for
|
||||
-- the view. Z layers allow drawing structures in higher layers
|
||||
-- in foreground of structures in lower layers. To add a structure
|
||||
-- to desired layer on display it is necessary to set the layer
|
||||
-- ID for the structure.
|
||||
|
||||
RemoveZLayer( me : mutable;
|
||||
theCView : CView from Graphic3d;
|
||||
theLayerId : ZLayerId from Graphic3d )
|
||||
is deferred;
|
||||
---Purpose: Remove Z layer from the specified view. All structures
|
||||
-- displayed at the moment in layer will be displayed in default layer
|
||||
-- ( the bottom-level z layer ). To unset layer ID from associated
|
||||
-- structures use method UnsetZLayer (...).
|
||||
|
||||
UnsetZLayer( me : mutable;
|
||||
theLayerId : ZLayerId from Graphic3d )
|
||||
is deferred;
|
||||
---Purpose: Unset Z layer ID for all structures. The structure
|
||||
-- indexes will be set to default layer ( the bottom-level z layer
|
||||
-- with ID = 0 ).
|
||||
|
||||
---C++: alias "
|
||||
//! Change Z layer of a structure already presented in view.
|
||||
Standard_EXPORT virtual void ChangeZLayer (const Graphic3d_CStructure& theCStructure, const Graphic3d_CView& theCView, const Graphic3d_ZLayerId theNewLayerId) = 0;"
|
||||
|
||||
SetZLayerSettings( me : mutable;
|
||||
theCView : CView from Graphic3d;
|
||||
theLayerId : ZLayerId from Graphic3d;
|
||||
theSettings : ZLayerSettings from Graphic3d)
|
||||
is deferred;
|
||||
---Purpose: Sets the settings for a single Z layer of specified view.
|
||||
|
||||
---C++: alias "
|
||||
//! Changes the priority of a structure within its Z layer in the specified view.
|
||||
Standard_EXPORT virtual void ChangePriority (const Graphic3d_CStructure& theCStructure, const Graphic3d_CView& theCView, const Standard_Integer theNewPriority) = 0;"
|
||||
|
||||
-----------------------------
|
||||
-- Category: Internal methods
|
||||
-----------------------------
|
||||
|
||||
PrintBoolean ( me;
|
||||
AComment : CString from Standard;
|
||||
AValue : Boolean from Standard );
|
||||
|
||||
PrintCLight ( me;
|
||||
ACLight : CLight from Graphic3d;
|
||||
AField : Integer from Standard );
|
||||
|
||||
---C++: alias "
|
||||
Standard_EXPORT void PrintCStructure (const Graphic3d_CStructure& ACStructure, const Standard_Integer AField) const;"
|
||||
|
||||
PrintCView ( me;
|
||||
ACView : CView from Graphic3d;
|
||||
AField : Integer from Standard );
|
||||
|
||||
PrintFunction ( me;
|
||||
AFunc : CString from Standard );
|
||||
|
||||
PrintInteger ( me;
|
||||
AComment : CString from Standard;
|
||||
AValue : Integer from Standard );
|
||||
|
||||
PrintIResult ( me;
|
||||
AFunc : CString from Standard;
|
||||
AResult : Integer from Standard );
|
||||
|
||||
PrintShortReal ( me;
|
||||
AComment : CString from Standard;
|
||||
AValue : ShortReal from Standard );
|
||||
|
||||
PrintMatrix ( me;
|
||||
AComment : CString from Standard;
|
||||
AMatrix : Array2OfReal from TColStd )
|
||||
raises TransformError from Graphic3d;
|
||||
|
||||
PrintString ( me;
|
||||
AComment : CString from Standard;
|
||||
AString : CString from Standard );
|
||||
|
||||
SetTrace ( me : mutable;
|
||||
ALevel : Integer from Standard )
|
||||
is static;
|
||||
|
||||
Trace ( me )
|
||||
returns Integer from Standard
|
||||
is static;
|
||||
|
||||
GetDisplayConnection (me)
|
||||
returns DisplayConnection from Aspect;
|
||||
---C++: return const &
|
||||
|
||||
---Purpose: returns Handle to display connection
|
||||
|
||||
IsDeviceLost (me)
|
||||
returns Boolean from Standard;
|
||||
-- Purpose: @return Standard_True in cases when the last view has been removed but some objects still present.
|
||||
|
||||
ResetDeviceLostFlag (me: mutable);
|
||||
-- Purpose: Resets DeviceLostFlag to default (Standard_False) state.
|
||||
|
||||
fields
|
||||
|
||||
MyTraceLevel : Integer from Standard is protected;
|
||||
myDisplayConnection: DisplayConnection from Aspect is protected;
|
||||
myDeviceLostFlag : Boolean from Standard is protected;
|
||||
|
||||
end GraphicDriver from Graphic3d;
|
@@ -14,7 +14,14 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Graphic3d_GraphicDriver.ixx>
|
||||
|
||||
#include <Graphic3d_GraphicDriver.hxx>
|
||||
#include <Graphic3d_Structure.hxx>
|
||||
#include <Graphic3d_StructureManager.hxx>
|
||||
#include <Graphic3d_TransformError.hxx>
|
||||
#include <Quantity_Color.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
Graphic3d_GraphicDriver::Graphic3d_GraphicDriver (const Handle(Aspect_DisplayConnection)& theDisp)
|
||||
: MyTraceLevel (0),
|
||||
|
409
src/Graphic3d/Graphic3d_GraphicDriver.hxx
Normal file
409
src/Graphic3d/Graphic3d_GraphicDriver.hxx
Normal file
@@ -0,0 +1,409 @@
|
||||
// Created on: 1997-01-28
|
||||
// Created by: CAL
|
||||
// Copyright (c) 1997-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 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 License 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_GraphicDriver_HeaderFile
|
||||
#define _Graphic3d_GraphicDriver_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Aspect_DisplayConnection.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <MMgt_TShared.hxx>
|
||||
#include <Graphic3d_CView.hxx>
|
||||
#include <Graphic3d_CStructure.hxx>
|
||||
#include <Aspect_GradientFillMethod.hxx>
|
||||
#include <Standard_CString.hxx>
|
||||
#include <Aspect_FillMethod.hxx>
|
||||
#include <Aspect_CLayer2d.hxx>
|
||||
#include <Standard_Size.hxx>
|
||||
#include <Quantity_NameOfColor.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Aspect_TypeOfTriedronPosition.hxx>
|
||||
#include <Aspect_TypeOfTriedronEcho.hxx>
|
||||
#include <Graphic3d_GraduatedTrihedron.hxx>
|
||||
#include <Graphic3d_Vec3.hxx>
|
||||
#include <Standard_ShortReal.hxx>
|
||||
#include <Standard_Address.hxx>
|
||||
#include <Graphic3d_PtrFrameBuffer.hxx>
|
||||
#include <Image_PixMap.hxx>
|
||||
#include <Graphic3d_BufferType.hxx>
|
||||
#include <Aspect_Handle.hxx>
|
||||
#include <Aspect_PrintAlgo.hxx>
|
||||
#include <Graphic3d_ExportFormat.hxx>
|
||||
#include <Graphic3d_SortType.hxx>
|
||||
#include <Graphic3d_ZLayerId.hxx>
|
||||
#include <Graphic3d_ZLayerSettings.hxx>
|
||||
#include <Graphic3d_CLight.hxx>
|
||||
#include <TColStd_Array2OfReal.hxx>
|
||||
class Graphic3d_TransformError;
|
||||
class Graphic3d_Structure;
|
||||
class Graphic3d_StructureManager;
|
||||
class Quantity_Color;
|
||||
class TCollection_AsciiString;
|
||||
|
||||
|
||||
class Graphic3d_GraphicDriver;
|
||||
DEFINE_STANDARD_HANDLE(Graphic3d_GraphicDriver, MMgt_TShared)
|
||||
|
||||
//! This class allows the definition of a graphic driver
|
||||
//! for 3d interface (currently only OpenGl driver is used).
|
||||
class Graphic3d_GraphicDriver : public MMgt_TShared
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! call_togl_inquirelight
|
||||
Standard_EXPORT virtual Standard_Integer InquireLightLimit() = 0;
|
||||
|
||||
//! call_togl_inquireplane
|
||||
Standard_EXPORT virtual Standard_Integer InquirePlaneLimit() = 0;
|
||||
|
||||
//! call_togl_inquireview
|
||||
Standard_EXPORT virtual Standard_Integer InquireViewLimit() = 0;
|
||||
|
||||
//! call_togl_displaystructure
|
||||
Standard_EXPORT virtual void DisplayStructure (const Graphic3d_CView& theCView, const Handle(Graphic3d_Structure)& theStructure, const Standard_Integer thePriority) = 0;
|
||||
|
||||
//! call_togl_erasestructure
|
||||
Standard_EXPORT virtual void EraseStructure (const Graphic3d_CView& theCView, const Handle(Graphic3d_Structure)& theStructure) = 0;
|
||||
|
||||
//! call_togl_removestructure
|
||||
Standard_EXPORT virtual void RemoveStructure (Handle(Graphic3d_CStructure)& theCStructure) = 0;
|
||||
|
||||
//! Creates new empty graphic structure
|
||||
Standard_EXPORT virtual Handle(Graphic3d_CStructure) Structure (const Handle(Graphic3d_StructureManager)& theManager) = 0;
|
||||
|
||||
//! call_togl_activateview
|
||||
Standard_EXPORT virtual void ActivateView (const Graphic3d_CView& ACView) = 0;
|
||||
|
||||
//! call_togl_antialiasing
|
||||
Standard_EXPORT virtual void AntiAliasing (const Graphic3d_CView& ACView, const Standard_Boolean AFlag) = 0;
|
||||
|
||||
//! call_togl_background
|
||||
Standard_EXPORT virtual void Background (const Graphic3d_CView& ACView) = 0;
|
||||
|
||||
//! call_togl_gradient_background
|
||||
Standard_EXPORT virtual void GradientBackground (const Graphic3d_CView& ACView, const Quantity_Color& AColor1, const Quantity_Color& AColor2, const Aspect_GradientFillMethod FillStyle) = 0;
|
||||
|
||||
Standard_EXPORT virtual void BackgroundImage (const Standard_CString FileName, const Graphic3d_CView& ACView, const Aspect_FillMethod FillStyle) = 0;
|
||||
|
||||
Standard_EXPORT virtual void SetBgImageStyle (const Graphic3d_CView& ACView, const Aspect_FillMethod FillStyle) = 0;
|
||||
|
||||
Standard_EXPORT virtual void SetBgGradientStyle (const Graphic3d_CView& ACView, const Aspect_GradientFillMethod FillStyle) = 0;
|
||||
|
||||
//! call_togl_cliplimit
|
||||
Standard_EXPORT virtual void ClipLimit (const Graphic3d_CView& ACView, const Standard_Boolean AWait) = 0;
|
||||
|
||||
//! call_togl_deactivateview
|
||||
Standard_EXPORT virtual void DeactivateView (const Graphic3d_CView& ACView) = 0;
|
||||
|
||||
//! call_togl_cliplimit
|
||||
Standard_EXPORT virtual void DepthCueing (const Graphic3d_CView& ACView, const Standard_Boolean AFlag) = 0;
|
||||
|
||||
//! call_togl_ratio_window
|
||||
Standard_EXPORT virtual void RatioWindow (const Graphic3d_CView& ACView) = 0;
|
||||
|
||||
//! Redraw content of the view
|
||||
Standard_EXPORT virtual void Redraw (const Graphic3d_CView& theCView, const Aspect_CLayer2d& theCUnderLayer, const Aspect_CLayer2d& theCOverLayer, const Standard_Integer theX = 0, const Standard_Integer theY = 0, const Standard_Integer theWidth = 0, const Standard_Integer theHeight = 0) = 0;
|
||||
|
||||
//! Redraw layer of immediate presentations
|
||||
Standard_EXPORT virtual void RedrawImmediate (const Graphic3d_CView& theCView, const Aspect_CLayer2d& theCUnderLayer, const Aspect_CLayer2d& theCOverLayer) = 0;
|
||||
|
||||
//! Invalidates content of the view but does not redraw it
|
||||
Standard_EXPORT virtual void Invalidate (const Graphic3d_CView& theCView) = 0;
|
||||
|
||||
//! call_togl_removeview
|
||||
Standard_EXPORT virtual void RemoveView (const Graphic3d_CView& ACView) = 0;
|
||||
|
||||
//! call_togl_setlight
|
||||
Standard_EXPORT virtual void SetLight (const Graphic3d_CView& ACView) = 0;
|
||||
|
||||
//! Pass clip planes to the associated graphic driver view.
|
||||
Standard_EXPORT virtual void SetClipPlanes (const Graphic3d_CView& theCView) = 0;
|
||||
|
||||
//! Inform graphic driver if camera assigned to view changes.
|
||||
Standard_EXPORT virtual void SetCamera (const Graphic3d_CView& theCView) = 0;
|
||||
|
||||
//! call_togl_setvisualisation
|
||||
Standard_EXPORT virtual void SetVisualisation (const Graphic3d_CView& ACView) = 0;
|
||||
|
||||
//! call_togl_view
|
||||
Standard_EXPORT virtual Standard_Boolean View (Graphic3d_CView& ACView) = 0;
|
||||
|
||||
Standard_EXPORT virtual void Environment (const Graphic3d_CView& ACView) = 0;
|
||||
|
||||
//! enables/disables usage of OpenGL vertex buffer arrays while drawing primitiev arrays
|
||||
Standard_EXPORT virtual void EnableVBO (const Standard_Boolean status) = 0;
|
||||
|
||||
//! Returns information about GPU memory usage.
|
||||
Standard_EXPORT virtual Standard_Boolean MemoryInfo (Standard_Size& theFreeBytes, TCollection_AsciiString& theInfo) const = 0;
|
||||
|
||||
//! call_togl_ztriedron_setup
|
||||
Standard_EXPORT virtual void ZBufferTriedronSetup (const Graphic3d_CView& theCView, const Quantity_NameOfColor XColor = Quantity_NOC_RED, const Quantity_NameOfColor YColor = Quantity_NOC_GREEN, const Quantity_NameOfColor ZColor = Quantity_NOC_BLUE1, const Standard_Real SizeRatio = 0.8, const Standard_Real AxisDiametr = 0.05, const Standard_Integer NbFacettes = 12) = 0;
|
||||
|
||||
//! call_togl_triedron_display
|
||||
Standard_EXPORT virtual void TriedronDisplay (const Graphic3d_CView& ACView, const Aspect_TypeOfTriedronPosition APosition = Aspect_TOTP_CENTER, const Quantity_NameOfColor AColor = Quantity_NOC_WHITE, const Standard_Real AScale = 0.02, const Standard_Boolean AsWireframe = Standard_True) = 0;
|
||||
|
||||
//! call_togl_triedron_erase
|
||||
Standard_EXPORT virtual void TriedronErase (const Graphic3d_CView& ACView) = 0;
|
||||
|
||||
//! call_togl_triedron_echo
|
||||
Standard_EXPORT virtual void TriedronEcho (const Graphic3d_CView& ACView, const Aspect_TypeOfTriedronEcho AType = Aspect_TOTE_NONE) = 0;
|
||||
|
||||
//! call_togl_graduatedtrihedron_display
|
||||
Standard_EXPORT virtual void GraduatedTrihedronDisplay (const Graphic3d_CView& theView, const Graphic3d_GraduatedTrihedron& theCubic) = 0;
|
||||
|
||||
//! call_togl_graduatedtrihedron_erase
|
||||
Standard_EXPORT virtual void GraduatedTrihedronErase (const Graphic3d_CView& theView) = 0;
|
||||
|
||||
//! Sets minimum and maximum points of scene bounding box for Graduated Trihedron
|
||||
//! stored in graphic view object.
|
||||
//! @param theView [in] current graphic view
|
||||
//! @param theMin [in] the minimum point of scene.
|
||||
//! @param theMax [in] the maximum point of scene.
|
||||
Standard_EXPORT virtual void GraduatedTrihedronMinMaxValues (const Graphic3d_CView& theView, const Graphic3d_Vec3 theMin, const Graphic3d_Vec3 theMax) = 0;
|
||||
|
||||
//! @param theDrawToFrontBuffer Advanced option to modify rendering mode:
|
||||
//! 1. TRUE. Drawing immediate mode structures directly to the front buffer over the scene image.
|
||||
//! Fast, so preferred for interactive work (used by default).
|
||||
//! However these extra drawings will be missed in image dump since it is performed from back buffer.
|
||||
//! Notice that since no pre-buffering used the V-Sync will be ignored and rendering could be seen
|
||||
//! in run-time (in case of slow hardware) and/or tearing may appear.
|
||||
//! So this is strongly recommended to draw only simple (fast) structures.
|
||||
//! 2. FALSE. Drawing immediate mode structures to the back buffer.
|
||||
//! The complete scene is redrawn first, so this mode is slower if scene contains complex data and/or V-Sync is turned on.
|
||||
//! But it works in any case and is especially useful for view dump because the dump image is read from the back buffer.
|
||||
//! @return previous mode.
|
||||
Standard_EXPORT virtual Standard_Boolean SetImmediateModeDrawToFront (const Graphic3d_CView& theCView, const Standard_Boolean theDrawToFrontBuffer) = 0;
|
||||
|
||||
//! Display structure in immediate mode on top of general presentation
|
||||
Standard_EXPORT virtual void DisplayImmediateStructure (const Graphic3d_CView& theCView, const Handle(Graphic3d_Structure)& theStructure) = 0;
|
||||
|
||||
//! Erases immediate structure
|
||||
Standard_EXPORT virtual void EraseImmediateStructure (const Graphic3d_CView& theCView, const Graphic3d_CStructure& theCStructure) = 0;
|
||||
|
||||
//! call_togl_layer2d
|
||||
Standard_EXPORT virtual void Layer (Aspect_CLayer2d& ACLayer) = 0;
|
||||
|
||||
//! call_togl_removelayer2d
|
||||
Standard_EXPORT virtual void RemoveLayer (const Aspect_CLayer2d& ACLayer) = 0;
|
||||
|
||||
//! call_togl_begin_layer2d
|
||||
Standard_EXPORT virtual void BeginLayer (const Aspect_CLayer2d& ACLayer) = 0;
|
||||
|
||||
//! call_togl_begin_polygon2d
|
||||
Standard_EXPORT virtual void BeginPolygon2d() = 0;
|
||||
|
||||
//! call_togl_begin_polyline2d
|
||||
Standard_EXPORT virtual void BeginPolyline2d() = 0;
|
||||
|
||||
//! call_togl_clear_layer2d
|
||||
Standard_EXPORT virtual void ClearLayer (const Aspect_CLayer2d& ACLayer) = 0;
|
||||
|
||||
//! call_togl_draw2d
|
||||
Standard_EXPORT virtual void Draw (const Standard_ShortReal X, const Standard_ShortReal Y) = 0;
|
||||
|
||||
//! call_togl_edge2d
|
||||
Standard_EXPORT virtual void Edge (const Standard_ShortReal X, const Standard_ShortReal Y) = 0;
|
||||
|
||||
//! call_togl_end_layer2d
|
||||
Standard_EXPORT virtual void EndLayer() = 0;
|
||||
|
||||
//! call_togl_end_polygon2d
|
||||
Standard_EXPORT virtual void EndPolygon2d() = 0;
|
||||
|
||||
//! call_togl_end_polyline2d
|
||||
Standard_EXPORT virtual void EndPolyline2d() = 0;
|
||||
|
||||
//! call_togl_move2d
|
||||
Standard_EXPORT virtual void Move (const Standard_ShortReal X, const Standard_ShortReal Y) = 0;
|
||||
|
||||
//! call_togl_rectangle2d
|
||||
Standard_EXPORT virtual void Rectangle (const Standard_ShortReal X, const Standard_ShortReal Y, const Standard_ShortReal Width, const Standard_ShortReal Height) = 0;
|
||||
|
||||
//! call_togl_set_color
|
||||
Standard_EXPORT virtual void SetColor (const Standard_ShortReal R, const Standard_ShortReal G, const Standard_ShortReal B) = 0;
|
||||
|
||||
//! call_togl_set_transparency
|
||||
Standard_EXPORT virtual void SetTransparency (const Standard_ShortReal ATransparency) = 0;
|
||||
|
||||
//! call_togl_unset_transparency
|
||||
Standard_EXPORT virtual void UnsetTransparency() = 0;
|
||||
|
||||
//! call_togl_set_line_attributes
|
||||
Standard_EXPORT virtual void SetLineAttributes (const Standard_Integer Type, const Standard_ShortReal Width) = 0;
|
||||
|
||||
//! Set text attributes for under-/overlayer.
|
||||
//! <Font> argument defines the name of the font to be used,
|
||||
//! <Type> argument defines the display type of the text,
|
||||
//! <R> <G> <B> values define the color of decal or subtitle background.
|
||||
//! To set the color of the text you can use the SetColor method.
|
||||
Standard_EXPORT virtual void SetTextAttributes (const Standard_CString Font, const Standard_Integer Type, const Standard_ShortReal R, const Standard_ShortReal G, const Standard_ShortReal B) = 0;
|
||||
|
||||
//! call_togl_text2d
|
||||
//! If AHeight < 0 default text height is used by driver (DefaultTextHeight method)
|
||||
Standard_EXPORT virtual void Text (const Standard_CString AText, const Standard_ShortReal X, const Standard_ShortReal Y, const Standard_ShortReal AHeight) = 0;
|
||||
|
||||
Standard_EXPORT virtual Standard_ShortReal DefaultTextHeight() const = 0;
|
||||
|
||||
//! call_togl_textsize2d
|
||||
Standard_EXPORT virtual void TextSize (const Standard_CString AText, const Standard_ShortReal AHeight, Standard_ShortReal& AWidth, Standard_ShortReal& AnAscent, Standard_ShortReal& ADescent) const = 0;
|
||||
|
||||
//! call_togl_backfacing
|
||||
Standard_EXPORT virtual void SetBackFacingModel (const Graphic3d_CView& aView) = 0;
|
||||
|
||||
//! Reads depths of shown pixels of the given
|
||||
//! rectangle (glReadPixels with GL_DEPTH_COMPONENT)
|
||||
Standard_EXPORT virtual void ReadDepths (const Graphic3d_CView& view, const Standard_Integer x, const Standard_Integer y, const Standard_Integer width, const Standard_Integer height, const Standard_Address buffer) const = 0;
|
||||
|
||||
//! Generate offscreen FBO in the graphic library.
|
||||
//! If not supported on hardware returns NULL.
|
||||
Standard_EXPORT virtual Graphic3d_PtrFrameBuffer FBOCreate (const Graphic3d_CView& view, const Standard_Integer width, const Standard_Integer height) = 0;
|
||||
|
||||
//! Remove offscreen FBO from the graphic library
|
||||
Standard_EXPORT virtual void FBORelease (const Graphic3d_CView& view, Graphic3d_PtrFrameBuffer& fboPtr) = 0;
|
||||
|
||||
//! Read offscreen FBO configuration.
|
||||
Standard_EXPORT virtual void FBOGetDimensions (const Graphic3d_CView& view, const Graphic3d_PtrFrameBuffer fboPtr, Standard_Integer& width, Standard_Integer& height, Standard_Integer& widthMax, Standard_Integer& heightMax) = 0;
|
||||
|
||||
//! Change offscreen FBO viewport.
|
||||
Standard_EXPORT virtual void FBOChangeViewport (const Graphic3d_CView& view, Graphic3d_PtrFrameBuffer& fboPtr, const Standard_Integer width, const Standard_Integer height) = 0;
|
||||
|
||||
//! Dump active rendering buffer into specified memory buffer.
|
||||
Standard_EXPORT virtual Standard_Boolean BufferDump (const Graphic3d_CView& theCView, Image_PixMap& theImage, const Graphic3d_BufferType& theBufferType) = 0;
|
||||
|
||||
//! call_togl_gllight
|
||||
Standard_EXPORT virtual void SetGLLightEnabled (const Graphic3d_CView& view, const Standard_Boolean isEnabled) const = 0;
|
||||
|
||||
//! call_togl_isgllight
|
||||
Standard_EXPORT virtual Standard_Boolean IsGLLightEnabled (const Graphic3d_CView& view) const = 0;
|
||||
|
||||
//! print the contents of all layers of the view to the printer.
|
||||
//! <hPrnDC> : Pass the PrinterDeviceContext (HDC),
|
||||
//! <showBackground> : When set to FALSE then print the view without background color
|
||||
//! (background is white)
|
||||
//! else set to TRUE for printing with current background color.
|
||||
//! <filename>: If != NULL, then the view will be printed to a file.
|
||||
//! <printAlgorithm>: Select print algorithm: stretch, tile.
|
||||
//! <theScaleFactor>: Scaling coefficient, used internally to scale the
|
||||
//! printings accordingly to the scale factor selected in the printer
|
||||
//! properties dialog.
|
||||
//! Returns Standard_True if the data is passed to the printer, otherwise
|
||||
//! Standard_False if the print operation failed due to the printer errors,
|
||||
//! or insufficient system memory available.
|
||||
Standard_EXPORT virtual Standard_Boolean Print (const Graphic3d_CView& ACView, const Aspect_CLayer2d& ACUnderLayer, const Aspect_CLayer2d& ACOverLayer, const Aspect_Handle hPrnDC, const Standard_Boolean showBackground, const Standard_CString filename, const Aspect_PrintAlgo printAlgorithm = Aspect_PA_STRETCH, const Standard_Real theScaleFactor = 1.0) const = 0;
|
||||
|
||||
|
||||
//! Export scene into the one of the Vector graphics formats (SVG, PS, PDF...).
|
||||
//! In contrast to Bitmaps, Vector graphics is scalable (so you may got quality benefits on printing to laser printer).
|
||||
//! Notice however that results may differ a lot and do not contain some elements.
|
||||
Standard_EXPORT virtual Standard_Boolean Export (const Standard_CString theFileName, const Graphic3d_ExportFormat theFormat, const Graphic3d_SortType theSortType, const Standard_Integer theWidth, const Standard_Integer theHeight, const Graphic3d_CView& theView, const Aspect_CLayer2d& theLayerUnder, const Aspect_CLayer2d& theLayerOver, const Standard_Real thePrecision = 0.005, const Standard_Address theProgressBarFunc = NULL, const Standard_Address theProgressObject = NULL) = 0;
|
||||
|
||||
|
||||
//! Marks BVH tree and the set of BVH primitives of correspondent priority list with id theLayerId as outdated.
|
||||
Standard_EXPORT virtual void InvalidateBVHData (Graphic3d_CView& theCView, const Standard_Integer theLayerId) = 0;
|
||||
|
||||
//! Add a new top-level z layer with ID <theLayerId> for
|
||||
//! the view. Z layers allow drawing structures in higher layers
|
||||
//! in foreground of structures in lower layers. To add a structure
|
||||
//! to desired layer on display it is necessary to set the layer
|
||||
//! ID for the structure.
|
||||
Standard_EXPORT virtual void AddZLayer (const Graphic3d_CView& theCView, const Graphic3d_ZLayerId theLayerId) = 0;
|
||||
|
||||
//! Remove Z layer from the specified view. All structures
|
||||
//! displayed at the moment in layer will be displayed in default layer
|
||||
//! ( the bottom-level z layer ). To unset layer ID from associated
|
||||
//! structures use method UnsetZLayer (...).
|
||||
Standard_EXPORT virtual void RemoveZLayer (const Graphic3d_CView& theCView, const Graphic3d_ZLayerId theLayerId) = 0;
|
||||
|
||||
//! Unset Z layer ID for all structures. The structure
|
||||
//! indexes will be set to default layer ( the bottom-level z layer
|
||||
//! with ID = 0 ).
|
||||
Standard_EXPORT virtual void UnsetZLayer (const Graphic3d_ZLayerId theLayerId) = 0;
|
||||
|
||||
//! Change Z layer of a structure already presented in view.
|
||||
Standard_EXPORT virtual void ChangeZLayer (const Graphic3d_CStructure& theCStructure, const Graphic3d_CView& theCView, const Graphic3d_ZLayerId theNewLayerId) = 0;
|
||||
|
||||
//! Sets the settings for a single Z layer of specified view.
|
||||
Standard_EXPORT virtual void SetZLayerSettings (const Graphic3d_CView& theCView, const Graphic3d_ZLayerId theLayerId, const Graphic3d_ZLayerSettings& theSettings) = 0;
|
||||
|
||||
//! Changes the priority of a structure within its Z layer in the specified view.
|
||||
Standard_EXPORT virtual void ChangePriority (const Graphic3d_CStructure& theCStructure, const Graphic3d_CView& theCView, const Standard_Integer theNewPriority) = 0;
|
||||
|
||||
Standard_EXPORT void PrintBoolean (const Standard_CString AComment, const Standard_Boolean AValue) const;
|
||||
|
||||
Standard_EXPORT void PrintCLight (const Graphic3d_CLight& ACLight, const Standard_Integer AField) const;
|
||||
|
||||
Standard_EXPORT void PrintCStructure (const Graphic3d_CStructure& ACStructure, const Standard_Integer AField) const;
|
||||
|
||||
Standard_EXPORT void PrintCView (const Graphic3d_CView& ACView, const Standard_Integer AField) const;
|
||||
|
||||
Standard_EXPORT void PrintFunction (const Standard_CString AFunc) const;
|
||||
|
||||
Standard_EXPORT void PrintInteger (const Standard_CString AComment, const Standard_Integer AValue) const;
|
||||
|
||||
Standard_EXPORT void PrintIResult (const Standard_CString AFunc, const Standard_Integer AResult) const;
|
||||
|
||||
Standard_EXPORT void PrintShortReal (const Standard_CString AComment, const Standard_ShortReal AValue) const;
|
||||
|
||||
Standard_EXPORT void PrintMatrix (const Standard_CString AComment, const TColStd_Array2OfReal& AMatrix) const;
|
||||
|
||||
Standard_EXPORT void PrintString (const Standard_CString AComment, const Standard_CString AString) const;
|
||||
|
||||
Standard_EXPORT void SetTrace (const Standard_Integer ALevel);
|
||||
|
||||
Standard_EXPORT Standard_Integer Trace() const;
|
||||
|
||||
//! returns Handle to display connection
|
||||
Standard_EXPORT const Handle(Aspect_DisplayConnection)& GetDisplayConnection() const;
|
||||
|
||||
Standard_EXPORT Standard_Boolean IsDeviceLost() const;
|
||||
|
||||
Standard_EXPORT void ResetDeviceLostFlag();
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Graphic3d_GraphicDriver,MMgt_TShared)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
//! Initialises the Driver
|
||||
Standard_EXPORT Graphic3d_GraphicDriver(const Handle(Aspect_DisplayConnection)& theDisp);
|
||||
|
||||
Standard_Integer MyTraceLevel;
|
||||
Handle(Aspect_DisplayConnection) myDisplayConnection;
|
||||
Standard_Boolean myDeviceLostFlag;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Graphic3d_GraphicDriver_HeaderFile
|
@@ -1,557 +0,0 @@
|
||||
-- Created on: 1991-09-06
|
||||
-- Created by: NW,JPB,CAL
|
||||
-- Copyright (c) 1991-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 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 License 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.
|
||||
|
||||
deferred class Group from Graphic3d inherits TShared
|
||||
|
||||
---Version:
|
||||
|
||||
---Purpose: This class allows the definition of groups
|
||||
-- of primitives inside of graphic objects (presentations).
|
||||
-- A group contains the primitives and attributes
|
||||
-- for which the range is limited to this group.
|
||||
-- The primitives of a group can be globally suppressed.
|
||||
--
|
||||
-- There are two main group usage models:
|
||||
--
|
||||
-- 1) Non-modifiable, or unbounded, group ('black box').
|
||||
-- Developers can repeat a sequence of
|
||||
-- SetPrimitivesAspect() with AddPrimitiveArray() methods arbitrary number of times
|
||||
-- to define arbitrary number of primitive "blocks" each having individual apect values.
|
||||
-- Any modification of such a group is forbidden, as aspects and primitives are mixed
|
||||
-- in memory without any high-level logical structure, and any modification is very likely to result
|
||||
-- in corruption of the group internal data.
|
||||
-- It is necessary to recreate such a group as a whole when some attribute should be changed.
|
||||
-- (for example, in terms of AIS it is necessary to re-Compute() the whole presentation each time).
|
||||
-- 2) Bounded group. Developers should specify the necessary group aspects with help of
|
||||
-- SetGroupPrimitivesAspect() and then add primitives to the group.
|
||||
-- Such a group have simplified organization in memory (a single block of attributes
|
||||
-- followed by a block of primitives) and therefore it can be modified, if it is necessary to
|
||||
-- change parameters of some aspect that has already been set, using methods:
|
||||
-- IsGroupPrimitivesAspectSet() to detect which aspect was set for primitives;
|
||||
-- GroupPrimitivesAspect() to read current aspect values
|
||||
-- and SetGroupPrimitivesAspect() to set new values.
|
||||
--
|
||||
-- Developers are strongly recommended to take all the above into account when filling Graphic3d_Group
|
||||
-- with aspects and primitives and choose the group usage model beforehand out of application needs.
|
||||
|
||||
---Warning:
|
||||
---References:
|
||||
|
||||
uses
|
||||
|
||||
Array1OfInteger from TColStd,
|
||||
Array1OfReal from TColStd,
|
||||
HArray1OfByte from TColStd,
|
||||
|
||||
ExtendedString from TCollection,
|
||||
|
||||
PlaneAngle from Quantity,
|
||||
|
||||
GroupAspect from Graphic3d,
|
||||
AspectLine3d from Graphic3d,
|
||||
AspectMarker3d from Graphic3d,
|
||||
AspectText3d from Graphic3d,
|
||||
AspectFillArea3d from Graphic3d,
|
||||
CAspectLine from Graphic3d,
|
||||
CAspectFillArea from Graphic3d,
|
||||
CAspectMarker from Graphic3d,
|
||||
CAspectText from Graphic3d,
|
||||
CStructurePtr from Graphic3d,
|
||||
HorizontalTextAlignment from Graphic3d,
|
||||
CBitFields4 from Graphic3d,
|
||||
GraphicDriver from Graphic3d,
|
||||
Structure from Graphic3d,
|
||||
StructurePtr from Graphic3d,
|
||||
TextPath from Graphic3d,
|
||||
Vector from Graphic3d,
|
||||
Array1OfVertex from Graphic3d,
|
||||
Array2OfVertex from Graphic3d,
|
||||
Vertex from Graphic3d,
|
||||
VerticalTextAlignment from Graphic3d,
|
||||
ArrayOfPrimitives from Graphic3d,
|
||||
TypeOfPrimitiveArray from Graphic3d,
|
||||
IndexBuffer from Graphic3d,
|
||||
Buffer from Graphic3d,
|
||||
BoundBuffer from Graphic3d,
|
||||
TransModeFlags from Graphic3d,
|
||||
BndBox4f from Graphic3d,
|
||||
Ax2 from gp
|
||||
|
||||
raises
|
||||
|
||||
GroupDefinitionError from Graphic3d,
|
||||
|
||||
OutOfRange from Standard
|
||||
|
||||
is
|
||||
Initialize (theStructure : Structure from Graphic3d)
|
||||
returns Group from Graphic3d;
|
||||
---Level: Public
|
||||
---Purpose: Creates a group in the structure <AStructure>.
|
||||
|
||||
---------------------------------------------------
|
||||
-- Category: Methods to modify the class definition
|
||||
---------------------------------------------------
|
||||
|
||||
Clear ( me : mutable;
|
||||
theUpdateStructureMgr : Boolean from Standard = Standard_True )
|
||||
is virtual;
|
||||
---Level: Public
|
||||
---Purpose: Supress all primitives and attributes of <me>.
|
||||
-- To clear group without update in Graphic3d_StructureManager
|
||||
-- pass Standard_False as <theUpdateStructureMgr>. This
|
||||
-- used on context and viewer destruction, when the pointer
|
||||
-- to structure manager in Graphic3d_Structure could be
|
||||
-- already released (pointers are used here to avoid handle
|
||||
-- cross-reference);
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
UpdateAspectLine ( me : mutable;
|
||||
theIsGlobal : Boolean from Standard )
|
||||
is deferred;
|
||||
|
||||
UpdateAspectFace ( me : mutable;
|
||||
theIsGlobal : Boolean from Standard )
|
||||
is deferred;
|
||||
|
||||
UpdateAspectMarker ( me : mutable;
|
||||
theIsGlobal : Boolean from Standard )
|
||||
is deferred;
|
||||
|
||||
UpdateAspectText ( me : mutable;
|
||||
theIsGlobal : Boolean from Standard )
|
||||
is deferred;
|
||||
|
||||
Destroy ( me : mutable )
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Supress the group <me> in the structure.
|
||||
---Category: Methods to modify the class definition
|
||||
---C++: alias ~
|
||||
|
||||
Remove ( me : mutable )
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Supress the group <me> in the structure.
|
||||
-- Warning: No more graphic operations in <me> after this call.
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
--SetTransformPersistence( me : mutable;
|
||||
-- AFlag : TransModeFlags from Graphic3d )
|
||||
---Level: Public
|
||||
---Purpose: Modifies the current modelling transform persistence (pan, zoom or rotate)
|
||||
--is static;
|
||||
|
||||
--TransformPersistence( me )
|
||||
-- returns TransModeFlags from Graphic3d
|
||||
---Level: Public
|
||||
---Purpose: Get the current modelling transform persistence (pan, zoom or rotate)
|
||||
--is static;
|
||||
|
||||
SetGroupPrimitivesAspect ( me : mutable;
|
||||
CTX : AspectLine3d from Graphic3d )
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Modifies the context for all the line primitives
|
||||
-- of the group.
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
SetGroupPrimitivesAspect ( me : mutable;
|
||||
CTX : AspectFillArea3d from Graphic3d )
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Modifies the context for all the face primitives
|
||||
-- of the group.
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
SetGroupPrimitivesAspect ( me : mutable;
|
||||
CTX : AspectText3d from Graphic3d )
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Modifies the context for all the text primitives
|
||||
-- of the group.
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
SetGroupPrimitivesAspect ( me : mutable;
|
||||
CTX : AspectMarker3d from Graphic3d )
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Modifies the context for all the marker primitives
|
||||
-- of the group.
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
SetPrimitivesAspect ( me : mutable;
|
||||
CTX : AspectLine3d from Graphic3d )
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Modifies the current context of the group to give
|
||||
-- another aspect for all the line primitives created
|
||||
-- after this call in the group.
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
SetPrimitivesAspect ( me : mutable;
|
||||
CTX : AspectFillArea3d from Graphic3d )
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Modifies the current context of the group to give
|
||||
-- another aspect for all the face primitives created
|
||||
-- after this call in the group.
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
SetPrimitivesAspect ( me : mutable;
|
||||
CTX : AspectText3d from Graphic3d )
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Modifies the current context of the group to give
|
||||
-- another aspect for all the text primitives created
|
||||
-- after this call in the group.
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
SetPrimitivesAspect ( me : mutable;
|
||||
CTX : AspectMarker3d from Graphic3d )
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Modifies the current context of the group to give
|
||||
-- another aspect for all the marker primitives created
|
||||
-- after this call in the group.
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
SetMinMaxValues ( me : mutable;
|
||||
XMin, YMin, ZMin : Real from Standard;
|
||||
XMax, YMax, ZMax : Real from Standard )
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Sets the coordinates of the boundary box of the
|
||||
-- group <me>.
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
-----------------------------------
|
||||
-- Category: Methods to create Text
|
||||
-----------------------------------
|
||||
|
||||
--------------------------------------------
|
||||
-- Summary of Texts --
|
||||
-- --
|
||||
-- Text has geometric and nongeometric --
|
||||
-- attributes. --
|
||||
-- --
|
||||
-- The geometric text attributes are : --
|
||||
-- --
|
||||
-- Character Height. --
|
||||
-- Character Up Vector. --
|
||||
-- Text Path. --
|
||||
-- Text Alignment Horizontal. --
|
||||
-- Text Alignment Vertical. --
|
||||
-- --
|
||||
-- The nongeometric text attributes are : --
|
||||
-- --
|
||||
-- Text Font. --
|
||||
-- Character Spacing. --
|
||||
-- Character Expansion Factor. --
|
||||
-- Text Color. --
|
||||
--------------------------------------------
|
||||
|
||||
Text ( me : mutable;
|
||||
AText : CString from Standard;
|
||||
APoint : Vertex from Graphic3d;
|
||||
AHeight : Real from Standard;
|
||||
AAngle : PlaneAngle from Quantity;
|
||||
ATp : TextPath from Graphic3d;
|
||||
AHta : HorizontalTextAlignment from Graphic3d;
|
||||
AVta : VerticalTextAlignment from Graphic3d;
|
||||
EvalMinMax : Boolean from Standard = Standard_True )
|
||||
is virtual;
|
||||
---Level: Public
|
||||
---Purpose: Creates the string <AText> at position <APoint>.
|
||||
-- The 3D point of attachment is projected. The text is
|
||||
-- written in the plane of projection.
|
||||
-- The attributes are given with respect to the plane of
|
||||
-- projection.
|
||||
-- AHeight : Height of text.
|
||||
-- (Relative to the Normalized Projection
|
||||
-- Coordinates (NPC) Space).
|
||||
-- AAngle : Orientation of the text
|
||||
-- (with respect to the horizontal).
|
||||
---Category: Methods to create Text
|
||||
|
||||
Text ( me : mutable;
|
||||
AText : CString from Standard;
|
||||
APoint : Vertex from Graphic3d;
|
||||
AHeight : Real from Standard;
|
||||
EvalMinMax : Boolean from Standard = Standard_True )
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Creates the string <AText> at position <APoint>.
|
||||
-- The 3D point of attachment is projected. The text is
|
||||
-- written in the plane of projection.
|
||||
-- The attributes are given with respect to the plane of
|
||||
-- projection.
|
||||
-- AHeight : Height of text.
|
||||
-- (Relative to the Normalized Projection
|
||||
-- Coordinates (NPC) Space).
|
||||
-- The other attributes have the following default values:
|
||||
-- AAngle : PI / 2.
|
||||
-- ATp : TP_RIGHT
|
||||
-- AHta : HTA_LEFT
|
||||
-- AVta : VTA_BOTTOM
|
||||
---Category: Methods to create Text
|
||||
|
||||
Text ( me : mutable;
|
||||
AText : ExtendedString from TCollection;
|
||||
APoint : Vertex from Graphic3d;
|
||||
AHeight : Real from Standard;
|
||||
AAngle : PlaneAngle from Quantity;
|
||||
ATp : TextPath from Graphic3d;
|
||||
AHta : HorizontalTextAlignment from Graphic3d;
|
||||
AVta : VerticalTextAlignment from Graphic3d;
|
||||
EvalMinMax : Boolean from Standard = Standard_True )
|
||||
is static;
|
||||
---Level: Internal
|
||||
---Purpose: Creates the string <AText> at position <APoint>.
|
||||
-- The 3D point of attachment is projected. The text is
|
||||
-- written in the plane of projection.
|
||||
-- The attributes are given with respect to the plane of
|
||||
-- projection.
|
||||
-- AHeight : Height of text.
|
||||
-- (Relative to the Normalized Projection
|
||||
-- Coordinates (NPC) Space).
|
||||
-- AAngle : Orientation of the text
|
||||
-- (with respect to the horizontal).
|
||||
---Category: Methods to create Text
|
||||
|
||||
Text ( me : mutable;
|
||||
AText : ExtendedString from TCollection;
|
||||
APoint : Vertex from Graphic3d;
|
||||
AHeight : Real from Standard;
|
||||
EvalMinMax : Boolean from Standard = Standard_True )
|
||||
is static;
|
||||
---Level: Internal
|
||||
---Purpose: Creates the string <AText> at position <APoint>.
|
||||
-- The 3D point of attachment is projected. The text is
|
||||
-- written in the plane of projection.
|
||||
-- The attributes are given with respect to the plane of
|
||||
-- projection.
|
||||
-- AHeight : Height of text.
|
||||
-- (Relative to the Normalized Projection
|
||||
-- Coordinates (NPC) Space).
|
||||
-- The other attributes have the following default values:
|
||||
-- AAngle : PI / 2.
|
||||
-- ATp : TP_RIGHT
|
||||
-- AHta : HTA_LEFT
|
||||
-- AVta : VTA_BOTTOM
|
||||
---Category: Methods to create Text
|
||||
|
||||
---------------------------------------
|
||||
---Category: Methods to create Triangle
|
||||
---------------------------------------
|
||||
|
||||
AddPrimitiveArray (me : mutable;
|
||||
theType : TypeOfPrimitiveArray from Graphic3d;
|
||||
theIndices : IndexBuffer from Graphic3d;
|
||||
theAttribs : Buffer from Graphic3d;
|
||||
theBounds : BoundBuffer from Graphic3d;
|
||||
theToEvalMinMax : Boolean from Standard = Standard_True) is virtual;
|
||||
---Level: Public
|
||||
---Purpose: Adds an array of primitives for display
|
||||
|
||||
AddPrimitiveArray( me : mutable;
|
||||
thePrim : ArrayOfPrimitives from Graphic3d;
|
||||
theToEvalMinMax : Boolean from Standard = Standard_True );
|
||||
---Level: Public
|
||||
---Purpose: Adds an array of primitives for display
|
||||
|
||||
Marker ( me : mutable;
|
||||
thePoint : Vertex from Graphic3d;
|
||||
theToEvalMinMax : Boolean from Standard = Standard_True )
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Creates a primitive array with single marker using AddPrimitiveArray().
|
||||
|
||||
UserDraw ( me : mutable;
|
||||
theObject : Address from Standard;
|
||||
theToEvalMinMax : Boolean from Standard = Standard_True;
|
||||
theContainsFacet : Boolean from Standard = Standard_False )
|
||||
is virtual;
|
||||
---Level: Public
|
||||
---Purpose: Creates a UserDraw primitive using obsolete API.
|
||||
|
||||
SetStencilTestOptions (me : mutable;
|
||||
theIsEnabled: Boolean from Standard)
|
||||
is deferred;
|
||||
---Purpose: sets the stencil test to theIsEnabled state;
|
||||
|
||||
SetFlippingOptions (me : mutable;
|
||||
theIsEnabled : Boolean from Standard;
|
||||
theRefPlane : Ax2 from gp)
|
||||
is deferred;
|
||||
---Purpose: sets the flipping to theIsEnabled state.
|
||||
|
||||
----------------------------
|
||||
-- Category: Inquire methods
|
||||
----------------------------
|
||||
|
||||
IsGroupPrimitivesAspectSet ( me;
|
||||
theAspect : GroupAspect from Graphic3d )
|
||||
returns Boolean from Standard
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns TRUE if aspect is set for the group.
|
||||
---Category: Inquire methods
|
||||
|
||||
GroupPrimitivesAspect ( me;
|
||||
CTXL : AspectLine3d from Graphic3d;
|
||||
CTXT : AspectText3d from Graphic3d;
|
||||
CTXM : AspectMarker3d from Graphic3d;
|
||||
CTXF : AspectFillArea3d from Graphic3d )
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns the context of all the primitives of the group.
|
||||
---Category: Inquire methods
|
||||
|
||||
PrimitivesAspect ( me;
|
||||
CTXL : AspectLine3d from Graphic3d;
|
||||
CTXT : AspectText3d from Graphic3d;
|
||||
CTXM : AspectMarker3d from Graphic3d;
|
||||
CTXF : AspectFillArea3d from Graphic3d )
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns the last inserted context in the group <me>
|
||||
-- foreach kind of primitives.
|
||||
---Category: Inquire methods
|
||||
|
||||
ContainsFacet ( me )
|
||||
returns Boolean from Standard
|
||||
is static;
|
||||
---Level: Internal
|
||||
---Purpose: Returns Standard_True if the group <me> contains
|
||||
-- Polygons, Triangles or Quadrangles.
|
||||
---Category: Inquire methods
|
||||
|
||||
IsDeleted ( me )
|
||||
returns Boolean from Standard
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns Standard_True if the group <me> is deleted.
|
||||
-- <me> is deleted after the call Remove (me) or the
|
||||
-- associated structure is deleted.
|
||||
---Category: Inquire methods
|
||||
|
||||
IsEmpty ( me )
|
||||
returns Boolean from Standard
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns Standard_True if the group <me> is empty.
|
||||
---Warning: A group is empty if the MinMaxValues method returns :
|
||||
-- XMin = YMin = ZMin = RealFirst ().
|
||||
-- XMax = YMax = ZMax = RealLast ().
|
||||
---Category: Inquire methods
|
||||
|
||||
MinMaxValues ( me;
|
||||
XMin, YMin, ZMin : out Real from Standard;
|
||||
XMax, YMax, ZMax : out Real from Standard )
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns the coordinates of the boundary box of the
|
||||
-- group <me>.
|
||||
---Warning: If the group <me> is empty then :
|
||||
-- XMin = YMin = ZMin = RealFirst ().
|
||||
-- XMax = YMax = ZMax = RealLast ().
|
||||
---Category: Inquire methods
|
||||
|
||||
BoundingBox ( me )
|
||||
returns BndBox4f from Graphic3d
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns boundary box of the group <me> without transformation applied,
|
||||
---if it is specified for the structure.
|
||||
---C++: return const &
|
||||
|
||||
ChangeBoundingBox ( me : mutable )
|
||||
returns BndBox4f from Graphic3d
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns non-const boundary box of the group <me> without transformation applied,
|
||||
---if it is specified for the structure.
|
||||
---C++: return &
|
||||
|
||||
Structure ( me )
|
||||
returns Structure from Graphic3d
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns the structure containing the group <me>.
|
||||
---Category: Inquire methods
|
||||
|
||||
----------------------------
|
||||
-- Category: Private methods
|
||||
----------------------------
|
||||
|
||||
MinMaxCoord ( me;
|
||||
XMin, YMin, ZMin : out Real from Standard;
|
||||
XMax, YMax, ZMax : out Real from Standard )
|
||||
is static private;
|
||||
---Level: Internal
|
||||
---Purpose: Returns the extreme coordinates found in the group.
|
||||
---Warning: If the group <me> is empty then :
|
||||
-- XMin = YMin = ZMin = RealFirst ().
|
||||
-- XMax = YMax = ZMax = RealLast ().
|
||||
---Category: Private methods
|
||||
|
||||
Update ( me )
|
||||
is static private;
|
||||
---Level: Internal
|
||||
---Purpose: Calls the Update method of the StructureManager which
|
||||
-- contains the associated Structure of the Group <me>.
|
||||
---Category: Private methods
|
||||
|
||||
SetClosed (me: mutable; theIsClosed : Boolean from Standard);
|
||||
---Purpose: Changes property shown that primitive arrays within this group form closed volume (do no contain open shells).
|
||||
|
||||
IsClosed (me) returns Boolean from Standard;
|
||||
---Purpose: Return true if primitive arrays within this graphic group form closed volume (do no contain open shells).
|
||||
|
||||
fields
|
||||
|
||||
--
|
||||
-- Class : Graphic3d_Group
|
||||
--
|
||||
-- Purpose : Declaration of variables specific to groups
|
||||
-- of primitives.
|
||||
--
|
||||
-- Reminder : A group is defined in a structure
|
||||
-- It acts as the smallest editable entity.
|
||||
|
||||
-- the state of the different contexts for primitives
|
||||
myCBitFields : CBitFields4 from Graphic3d is protected;
|
||||
|
||||
-- the structure contains the group
|
||||
myStructure : StructurePtr from Graphic3d is protected;
|
||||
|
||||
-- the min-max
|
||||
myBounds : BndBox4f from Graphic3d is protected;
|
||||
|
||||
-- Identifies group forming closed volume. Used to filter groups for back face culling and capping algorithms.
|
||||
myIsClosed : Boolean from Standard is protected;
|
||||
|
||||
ContextLine : CAspectLine from Graphic3d is protected;
|
||||
ContextFillArea : CAspectFillArea from Graphic3d is protected;
|
||||
ContextMarker : CAspectMarker from Graphic3d is protected;
|
||||
ContextText : CAspectText from Graphic3d is protected;
|
||||
|
||||
friends
|
||||
|
||||
class Structure from Graphic3d
|
||||
|
||||
end Group;
|
@@ -13,21 +13,31 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Graphic3d_Group.ixx>
|
||||
|
||||
#include <gp_Ax2.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <Graphic3d_ArrayOfPoints.hxx>
|
||||
#include <Graphic3d_StructureManager.hxx>
|
||||
#include <Graphic3d_ArrayOfPrimitives.hxx>
|
||||
#include <Graphic3d_AspectFillArea3d.hxx>
|
||||
#include <Graphic3d_AspectLine3d.hxx>
|
||||
#include <Graphic3d_AspectMarker3d.hxx>
|
||||
#include <Graphic3d_AspectText3d.hxx>
|
||||
#include <Graphic3d_CStructure.hxx>
|
||||
#include <Graphic3d_Group.hxx>
|
||||
#include <Graphic3d_GroupDefinitionError.hxx>
|
||||
#include <Graphic3d_ShaderProgram.hxx>
|
||||
#include <Graphic3d_TransModeFlags.hxx>
|
||||
#include <Graphic3d_Structure.hxx>
|
||||
#include <Graphic3d_Structure.pxx>
|
||||
#include <Graphic3d_StructureManager.hxx>
|
||||
#include <Graphic3d_TextureMap.hxx>
|
||||
#include <Graphic3d_TransModeFlags.hxx>
|
||||
#include <Message.hxx>
|
||||
#include <Message_Messenger.hxx>
|
||||
#include <NCollection_String.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
#include <Graphic3d_CStructure.hxx>
|
||||
#include <Graphic3d_Structure.pxx>
|
||||
#include <TCollection_ExtendedString.hxx>
|
||||
|
||||
#define MyContainsFacet myCBitFields.bool2
|
||||
|
||||
|
318
src/Graphic3d/Graphic3d_Group.hxx
Normal file
318
src/Graphic3d/Graphic3d_Group.hxx
Normal file
@@ -0,0 +1,318 @@
|
||||
// Created on: 1991-09-06
|
||||
// Created by: NW,JPB,CAL
|
||||
// Copyright (c) 1991-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 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 License 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_Group_HeaderFile
|
||||
#define _Graphic3d_Group_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Graphic3d_CBitFields4.hxx>
|
||||
#include <Graphic3d_StructurePtr.hxx>
|
||||
#include <Graphic3d_BndBox4f.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Graphic3d_CAspectLine.hxx>
|
||||
#include <Graphic3d_CAspectFillArea.hxx>
|
||||
#include <Graphic3d_CAspectMarker.hxx>
|
||||
#include <Graphic3d_CAspectText.hxx>
|
||||
#include <MMgt_TShared.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Standard_CString.hxx>
|
||||
#include <Graphic3d_Vertex.hxx>
|
||||
#include <Quantity_PlaneAngle.hxx>
|
||||
#include <Graphic3d_TextPath.hxx>
|
||||
#include <Graphic3d_HorizontalTextAlignment.hxx>
|
||||
#include <Graphic3d_VerticalTextAlignment.hxx>
|
||||
#include <Graphic3d_TypeOfPrimitiveArray.hxx>
|
||||
#include <Graphic3d_IndexBuffer.hxx>
|
||||
#include <Graphic3d_Buffer.hxx>
|
||||
#include <Graphic3d_BoundBuffer.hxx>
|
||||
#include <Standard_Address.hxx>
|
||||
#include <Graphic3d_GroupAspect.hxx>
|
||||
class Graphic3d_GroupDefinitionError;
|
||||
class Standard_OutOfRange;
|
||||
class Graphic3d_Structure;
|
||||
class Graphic3d_AspectLine3d;
|
||||
class Graphic3d_AspectFillArea3d;
|
||||
class Graphic3d_AspectText3d;
|
||||
class Graphic3d_AspectMarker3d;
|
||||
class TCollection_ExtendedString;
|
||||
class Graphic3d_ArrayOfPrimitives;
|
||||
class gp_Ax2;
|
||||
|
||||
|
||||
class Graphic3d_Group;
|
||||
DEFINE_STANDARD_HANDLE(Graphic3d_Group, MMgt_TShared)
|
||||
|
||||
//! This class allows the definition of groups
|
||||
//! of primitives inside of graphic objects (presentations).
|
||||
//! A group contains the primitives and attributes
|
||||
//! for which the range is limited to this group.
|
||||
//! The primitives of a group can be globally suppressed.
|
||||
//!
|
||||
//! There are two main group usage models:
|
||||
//!
|
||||
//! 1) Non-modifiable, or unbounded, group ('black box').
|
||||
//! Developers can repeat a sequence of
|
||||
//! SetPrimitivesAspect() with AddPrimitiveArray() methods arbitrary number of times
|
||||
//! to define arbitrary number of primitive "blocks" each having individual apect values.
|
||||
//! Any modification of such a group is forbidden, as aspects and primitives are mixed
|
||||
//! in memory without any high-level logical structure, and any modification is very likely to result
|
||||
//! in corruption of the group internal data.
|
||||
//! It is necessary to recreate such a group as a whole when some attribute should be changed.
|
||||
//! (for example, in terms of AIS it is necessary to re-Compute() the whole presentation each time).
|
||||
//! 2) Bounded group. Developers should specify the necessary group aspects with help of
|
||||
//! SetGroupPrimitivesAspect() and then add primitives to the group.
|
||||
//! Such a group have simplified organization in memory (a single block of attributes
|
||||
//! followed by a block of primitives) and therefore it can be modified, if it is necessary to
|
||||
//! change parameters of some aspect that has already been set, using methods:
|
||||
//! IsGroupPrimitivesAspectSet() to detect which aspect was set for primitives;
|
||||
//! GroupPrimitivesAspect() to read current aspect values
|
||||
//! and SetGroupPrimitivesAspect() to set new values.
|
||||
//!
|
||||
//! Developers are strongly recommended to take all the above into account when filling Graphic3d_Group
|
||||
//! with aspects and primitives and choose the group usage model beforehand out of application needs.
|
||||
class Graphic3d_Group : public MMgt_TShared
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Supress all primitives and attributes of <me>.
|
||||
//! To clear group without update in Graphic3d_StructureManager
|
||||
//! pass Standard_False as <theUpdateStructureMgr>. This
|
||||
//! used on context and viewer destruction, when the pointer
|
||||
//! to structure manager in Graphic3d_Structure could be
|
||||
//! already released (pointers are used here to avoid handle
|
||||
//! cross-reference);
|
||||
Standard_EXPORT virtual void Clear (const Standard_Boolean theUpdateStructureMgr = Standard_True);
|
||||
|
||||
Standard_EXPORT virtual void UpdateAspectLine (const Standard_Boolean theIsGlobal) = 0;
|
||||
|
||||
Standard_EXPORT virtual void UpdateAspectFace (const Standard_Boolean theIsGlobal) = 0;
|
||||
|
||||
Standard_EXPORT virtual void UpdateAspectMarker (const Standard_Boolean theIsGlobal) = 0;
|
||||
|
||||
Standard_EXPORT virtual void UpdateAspectText (const Standard_Boolean theIsGlobal) = 0;
|
||||
|
||||
//! Supress the group <me> in the structure.
|
||||
Standard_EXPORT void Destroy();
|
||||
~Graphic3d_Group()
|
||||
{
|
||||
Destroy();
|
||||
}
|
||||
|
||||
//! Supress the group <me> in the structure.
|
||||
//! Warning: No more graphic operations in <me> after this call.
|
||||
//! Modifies the current modelling transform persistence (pan, zoom or rotate)
|
||||
//! Get the current modelling transform persistence (pan, zoom or rotate)
|
||||
Standard_EXPORT void Remove();
|
||||
|
||||
//! Modifies the context for all the line primitives
|
||||
//! of the group.
|
||||
Standard_EXPORT void SetGroupPrimitivesAspect (const Handle(Graphic3d_AspectLine3d)& CTX);
|
||||
|
||||
//! Modifies the context for all the face primitives
|
||||
//! of the group.
|
||||
Standard_EXPORT void SetGroupPrimitivesAspect (const Handle(Graphic3d_AspectFillArea3d)& CTX);
|
||||
|
||||
//! Modifies the context for all the text primitives
|
||||
//! of the group.
|
||||
Standard_EXPORT void SetGroupPrimitivesAspect (const Handle(Graphic3d_AspectText3d)& CTX);
|
||||
|
||||
//! Modifies the context for all the marker primitives
|
||||
//! of the group.
|
||||
Standard_EXPORT void SetGroupPrimitivesAspect (const Handle(Graphic3d_AspectMarker3d)& CTX);
|
||||
|
||||
//! Modifies the current context of the group to give
|
||||
//! another aspect for all the line primitives created
|
||||
//! after this call in the group.
|
||||
Standard_EXPORT void SetPrimitivesAspect (const Handle(Graphic3d_AspectLine3d)& CTX);
|
||||
|
||||
//! Modifies the current context of the group to give
|
||||
//! another aspect for all the face primitives created
|
||||
//! after this call in the group.
|
||||
Standard_EXPORT void SetPrimitivesAspect (const Handle(Graphic3d_AspectFillArea3d)& CTX);
|
||||
|
||||
//! Modifies the current context of the group to give
|
||||
//! another aspect for all the text primitives created
|
||||
//! after this call in the group.
|
||||
Standard_EXPORT void SetPrimitivesAspect (const Handle(Graphic3d_AspectText3d)& CTX);
|
||||
|
||||
//! Modifies the current context of the group to give
|
||||
//! another aspect for all the marker primitives created
|
||||
//! after this call in the group.
|
||||
Standard_EXPORT void SetPrimitivesAspect (const Handle(Graphic3d_AspectMarker3d)& CTX);
|
||||
|
||||
//! Sets the coordinates of the boundary box of the
|
||||
//! group <me>.
|
||||
Standard_EXPORT void SetMinMaxValues (const Standard_Real XMin, const Standard_Real YMin, const Standard_Real ZMin, const Standard_Real XMax, const Standard_Real YMax, const Standard_Real ZMax);
|
||||
|
||||
//! Creates the string <AText> at position <APoint>.
|
||||
//! The 3D point of attachment is projected. The text is
|
||||
//! written in the plane of projection.
|
||||
//! The attributes are given with respect to the plane of
|
||||
//! projection.
|
||||
//! AHeight : Height of text.
|
||||
//! (Relative to the Normalized Projection
|
||||
//! Coordinates (NPC) Space).
|
||||
//! AAngle : Orientation of the text
|
||||
//! (with respect to the horizontal).
|
||||
Standard_EXPORT virtual void Text (const Standard_CString AText, const Graphic3d_Vertex& APoint, const Standard_Real AHeight, const Quantity_PlaneAngle AAngle, const Graphic3d_TextPath ATp, const Graphic3d_HorizontalTextAlignment AHta, const Graphic3d_VerticalTextAlignment AVta, const Standard_Boolean EvalMinMax = Standard_True);
|
||||
|
||||
//! Creates the string <AText> at position <APoint>.
|
||||
//! The 3D point of attachment is projected. The text is
|
||||
//! written in the plane of projection.
|
||||
//! The attributes are given with respect to the plane of
|
||||
//! projection.
|
||||
//! AHeight : Height of text.
|
||||
//! (Relative to the Normalized Projection
|
||||
//! Coordinates (NPC) Space).
|
||||
//! The other attributes have the following default values:
|
||||
//! AAngle : PI / 2.
|
||||
//! ATp : TP_RIGHT
|
||||
//! AHta : HTA_LEFT
|
||||
//! AVta : VTA_BOTTOM
|
||||
Standard_EXPORT void Text (const Standard_CString AText, const Graphic3d_Vertex& APoint, const Standard_Real AHeight, const Standard_Boolean EvalMinMax = Standard_True);
|
||||
|
||||
//! Creates the string <AText> at position <APoint>.
|
||||
//! The 3D point of attachment is projected. The text is
|
||||
//! written in the plane of projection.
|
||||
//! The attributes are given with respect to the plane of
|
||||
//! projection.
|
||||
//! AHeight : Height of text.
|
||||
//! (Relative to the Normalized Projection
|
||||
//! Coordinates (NPC) Space).
|
||||
//! AAngle : Orientation of the text
|
||||
//! (with respect to the horizontal).
|
||||
Standard_EXPORT void Text (const TCollection_ExtendedString& AText, const Graphic3d_Vertex& APoint, const Standard_Real AHeight, const Quantity_PlaneAngle AAngle, const Graphic3d_TextPath ATp, const Graphic3d_HorizontalTextAlignment AHta, const Graphic3d_VerticalTextAlignment AVta, const Standard_Boolean EvalMinMax = Standard_True);
|
||||
|
||||
//! Creates the string <AText> at position <APoint>.
|
||||
//! The 3D point of attachment is projected. The text is
|
||||
//! written in the plane of projection.
|
||||
//! The attributes are given with respect to the plane of
|
||||
//! projection.
|
||||
//! AHeight : Height of text.
|
||||
//! (Relative to the Normalized Projection
|
||||
//! Coordinates (NPC) Space).
|
||||
//! The other attributes have the following default values:
|
||||
//! AAngle : PI / 2.
|
||||
//! ATp : TP_RIGHT
|
||||
//! AHta : HTA_LEFT
|
||||
//! AVta : VTA_BOTTOM
|
||||
Standard_EXPORT void Text (const TCollection_ExtendedString& AText, const Graphic3d_Vertex& APoint, const Standard_Real AHeight, const Standard_Boolean EvalMinMax = Standard_True);
|
||||
|
||||
//! Adds an array of primitives for display
|
||||
Standard_EXPORT virtual void AddPrimitiveArray (const Graphic3d_TypeOfPrimitiveArray theType, const Handle(Graphic3d_IndexBuffer)& theIndices, const Handle(Graphic3d_Buffer)& theAttribs, const Handle(Graphic3d_BoundBuffer)& theBounds, const Standard_Boolean theToEvalMinMax = Standard_True);
|
||||
|
||||
//! Adds an array of primitives for display
|
||||
Standard_EXPORT void AddPrimitiveArray (const Handle(Graphic3d_ArrayOfPrimitives)& thePrim, const Standard_Boolean theToEvalMinMax = Standard_True);
|
||||
|
||||
//! Creates a primitive array with single marker using AddPrimitiveArray().
|
||||
Standard_EXPORT void Marker (const Graphic3d_Vertex& thePoint, const Standard_Boolean theToEvalMinMax = Standard_True);
|
||||
|
||||
//! Creates a UserDraw primitive using obsolete API.
|
||||
Standard_EXPORT virtual void UserDraw (const Standard_Address theObject, const Standard_Boolean theToEvalMinMax = Standard_True, const Standard_Boolean theContainsFacet = Standard_False);
|
||||
|
||||
//! sets the stencil test to theIsEnabled state;
|
||||
Standard_EXPORT virtual void SetStencilTestOptions (const Standard_Boolean theIsEnabled) = 0;
|
||||
|
||||
//! sets the flipping to theIsEnabled state.
|
||||
Standard_EXPORT virtual void SetFlippingOptions (const Standard_Boolean theIsEnabled, const gp_Ax2& theRefPlane) = 0;
|
||||
|
||||
//! Returns TRUE if aspect is set for the group.
|
||||
Standard_EXPORT Standard_Boolean IsGroupPrimitivesAspectSet (const Graphic3d_GroupAspect theAspect) const;
|
||||
|
||||
//! Returns the context of all the primitives of the group.
|
||||
Standard_EXPORT void GroupPrimitivesAspect (const Handle(Graphic3d_AspectLine3d)& CTXL, const Handle(Graphic3d_AspectText3d)& CTXT, const Handle(Graphic3d_AspectMarker3d)& CTXM, const Handle(Graphic3d_AspectFillArea3d)& CTXF) const;
|
||||
|
||||
//! Returns the last inserted context in the group <me>
|
||||
//! foreach kind of primitives.
|
||||
Standard_EXPORT void PrimitivesAspect (const Handle(Graphic3d_AspectLine3d)& CTXL, const Handle(Graphic3d_AspectText3d)& CTXT, const Handle(Graphic3d_AspectMarker3d)& CTXM, const Handle(Graphic3d_AspectFillArea3d)& CTXF) const;
|
||||
|
||||
//! Returns Standard_True if the group <me> contains
|
||||
//! Polygons, Triangles or Quadrangles.
|
||||
Standard_EXPORT Standard_Boolean ContainsFacet() const;
|
||||
|
||||
//! Returns Standard_True if the group <me> is deleted.
|
||||
//! <me> is deleted after the call Remove (me) or the
|
||||
//! associated structure is deleted.
|
||||
Standard_EXPORT Standard_Boolean IsDeleted() const;
|
||||
|
||||
//! Returns Standard_True if the group <me> is empty.
|
||||
Standard_EXPORT Standard_Boolean IsEmpty() const;
|
||||
|
||||
//! Returns the coordinates of the boundary box of the
|
||||
//! group <me>.
|
||||
Standard_EXPORT void MinMaxValues (Standard_Real& XMin, Standard_Real& YMin, Standard_Real& ZMin, Standard_Real& XMax, Standard_Real& YMax, Standard_Real& ZMax) const;
|
||||
|
||||
//! Returns boundary box of the group <me> without transformation applied,
|
||||
Standard_EXPORT const Graphic3d_BndBox4f& BoundingBox() const;
|
||||
|
||||
//! Returns non-const boundary box of the group <me> without transformation applied,
|
||||
Standard_EXPORT Graphic3d_BndBox4f& ChangeBoundingBox();
|
||||
|
||||
//! Returns the structure containing the group <me>.
|
||||
Standard_EXPORT Handle(Graphic3d_Structure) Structure() const;
|
||||
|
||||
//! Changes property shown that primitive arrays within this group form closed volume (do no contain open shells).
|
||||
Standard_EXPORT void SetClosed (const Standard_Boolean theIsClosed);
|
||||
|
||||
//! Return true if primitive arrays within this graphic group form closed volume (do no contain open shells).
|
||||
Standard_EXPORT Standard_Boolean IsClosed() const;
|
||||
|
||||
friend class Graphic3d_Structure;
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Graphic3d_Group,MMgt_TShared)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
//! Creates a group in the structure <AStructure>.
|
||||
Standard_EXPORT Graphic3d_Group(const Handle(Graphic3d_Structure)& theStructure);
|
||||
|
||||
Graphic3d_CBitFields4 myCBitFields;
|
||||
Graphic3d_StructurePtr myStructure;
|
||||
Graphic3d_BndBox4f myBounds;
|
||||
Standard_Boolean myIsClosed;
|
||||
Graphic3d_CAspectLine ContextLine;
|
||||
Graphic3d_CAspectFillArea ContextFillArea;
|
||||
Graphic3d_CAspectMarker ContextMarker;
|
||||
Graphic3d_CAspectText ContextText;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
//! Returns the extreme coordinates found in the group.
|
||||
Standard_EXPORT void MinMaxCoord (Standard_Real& XMin, Standard_Real& YMin, Standard_Real& ZMin, Standard_Real& XMax, Standard_Real& YMax, Standard_Real& ZMax) const;
|
||||
|
||||
//! Calls the Update method of the StructureManager which
|
||||
//! contains the associated Structure of the Group <me>.
|
||||
Standard_EXPORT void Update() const;
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Graphic3d_Group_HeaderFile
|
33
src/Graphic3d/Graphic3d_GroupAspect.hxx
Normal file
33
src/Graphic3d/Graphic3d_GroupAspect.hxx
Normal file
@@ -0,0 +1,33 @@
|
||||
// Created on: 1993-03-31
|
||||
// Created by: NW,JPB,CAL
|
||||
// Copyright (c) 1993-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 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 License 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_GroupAspect_HeaderFile
|
||||
#define _Graphic3d_GroupAspect_HeaderFile
|
||||
|
||||
//! Identifies primitives aspects defined per group.
|
||||
//! - ASPECT_LINE: aspect for line primitives;
|
||||
//! - ASPECT_TEXT: aspect for text primitives;
|
||||
//! - ASPECT_MARKER: aspect for marker primitives;
|
||||
//! - ASPECT_FILL_AREA: aspect for face primitives.
|
||||
enum Graphic3d_GroupAspect
|
||||
{
|
||||
Graphic3d_ASPECT_LINE,
|
||||
Graphic3d_ASPECT_TEXT,
|
||||
Graphic3d_ASPECT_MARKER,
|
||||
Graphic3d_ASPECT_FILL_AREA
|
||||
};
|
||||
|
||||
#endif // _Graphic3d_GroupAspect_HeaderFile
|
37
src/Graphic3d/Graphic3d_GroupDefinitionError.hxx
Normal file
37
src/Graphic3d/Graphic3d_GroupDefinitionError.hxx
Normal file
@@ -0,0 +1,37 @@
|
||||
// Created on: 1993-03-31
|
||||
// Created by: NW,JPB,CAL
|
||||
// Copyright (c) 1993-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 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 License 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_GroupDefinitionError_HeaderFile
|
||||
#define _Graphic3d_GroupDefinitionError_HeaderFile
|
||||
|
||||
#include <Standard_Type.hxx>
|
||||
#include <Standard_DefineException.hxx>
|
||||
#include <Standard_SStream.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
|
||||
class Graphic3d_GroupDefinitionError;
|
||||
DEFINE_STANDARD_HANDLE(Graphic3d_GroupDefinitionError, Standard_OutOfRange)
|
||||
|
||||
#if !defined No_Exception && !defined No_Graphic3d_GroupDefinitionError
|
||||
#define Graphic3d_GroupDefinitionError_Raise_if(CONDITION, MESSAGE) \
|
||||
if (CONDITION) Graphic3d_GroupDefinitionError::Raise(MESSAGE);
|
||||
#else
|
||||
#define Graphic3d_GroupDefinitionError_Raise_if(CONDITION, MESSAGE)
|
||||
#endif
|
||||
|
||||
DEFINE_STANDARD_EXCEPTION(Graphic3d_GroupDefinitionError, Standard_OutOfRange)
|
||||
|
||||
#endif // _Graphic3d_GroupDefinitionError_HeaderFile
|
29
src/Graphic3d/Graphic3d_HorizontalTextAlignment.hxx
Normal file
29
src/Graphic3d/Graphic3d_HorizontalTextAlignment.hxx
Normal file
@@ -0,0 +1,29 @@
|
||||
// Created on: 1993-03-31
|
||||
// Created by: NW,JPB,CAL
|
||||
// Copyright (c) 1993-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 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 License 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_HorizontalTextAlignment_HeaderFile
|
||||
#define _Graphic3d_HorizontalTextAlignment_HeaderFile
|
||||
|
||||
//! Defines the horizontal position of the text
|
||||
//! relative to its anchor.
|
||||
enum Graphic3d_HorizontalTextAlignment
|
||||
{
|
||||
Graphic3d_HTA_LEFT,
|
||||
Graphic3d_HTA_CENTER,
|
||||
Graphic3d_HTA_RIGHT
|
||||
};
|
||||
|
||||
#endif // _Graphic3d_HorizontalTextAlignment_HeaderFile
|
37
src/Graphic3d/Graphic3d_InitialisationError.hxx
Normal file
37
src/Graphic3d/Graphic3d_InitialisationError.hxx
Normal file
@@ -0,0 +1,37 @@
|
||||
// Created on: 1993-03-31
|
||||
// Created by: NW,JPB,CAL
|
||||
// Copyright (c) 1993-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 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 License 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_InitialisationError_HeaderFile
|
||||
#define _Graphic3d_InitialisationError_HeaderFile
|
||||
|
||||
#include <Standard_Type.hxx>
|
||||
#include <Standard_DefineException.hxx>
|
||||
#include <Standard_SStream.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
|
||||
class Graphic3d_InitialisationError;
|
||||
DEFINE_STANDARD_HANDLE(Graphic3d_InitialisationError, Standard_OutOfRange)
|
||||
|
||||
#if !defined No_Exception && !defined No_Graphic3d_InitialisationError
|
||||
#define Graphic3d_InitialisationError_Raise_if(CONDITION, MESSAGE) \
|
||||
if (CONDITION) Graphic3d_InitialisationError::Raise(MESSAGE);
|
||||
#else
|
||||
#define Graphic3d_InitialisationError_Raise_if(CONDITION, MESSAGE)
|
||||
#endif
|
||||
|
||||
DEFINE_STANDARD_EXCEPTION(Graphic3d_InitialisationError, Standard_OutOfRange)
|
||||
|
||||
#endif // _Graphic3d_InitialisationError_HeaderFile
|
30
src/Graphic3d/Graphic3d_LevelOfTextureAnisotropy.hxx
Normal file
30
src/Graphic3d/Graphic3d_LevelOfTextureAnisotropy.hxx
Normal file
@@ -0,0 +1,30 @@
|
||||
// Created on: 1993-03-31
|
||||
// Created by: NW,JPB,CAL
|
||||
// Copyright (c) 1993-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 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 License 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_LevelOfTextureAnisotropy_HeaderFile
|
||||
#define _Graphic3d_LevelOfTextureAnisotropy_HeaderFile
|
||||
|
||||
//! Level of anisotropy filter.
|
||||
//! Notice that actual quality depends on hardware capabilities!
|
||||
enum Graphic3d_LevelOfTextureAnisotropy
|
||||
{
|
||||
Graphic3d_LOTA_OFF,
|
||||
Graphic3d_LOTA_FAST,
|
||||
Graphic3d_LOTA_MIDDLE,
|
||||
Graphic3d_LOTA_QUALITY
|
||||
};
|
||||
|
||||
#endif // _Graphic3d_LevelOfTextureAnisotropy_HeaderFile
|
@@ -1,522 +0,0 @@
|
||||
-- Created by: NW,JPB,CAL
|
||||
-- Copyright (c) 1991-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 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 License 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.
|
||||
|
||||
-- 28-07-97 : PCT ; support for texture mapping
|
||||
-- 08-04-98 : FGU ; support for emission
|
||||
-- 26-03-99 : FMN ; Compatibilite ascendante: Ajout methodes SetColor() et Color()
|
||||
-- 09-04-99 : GG ; Compatibilite ascendante:
|
||||
-- NameOfPhysicalMaterial disparait.
|
||||
|
||||
class MaterialAspect from Graphic3d
|
||||
|
||||
---Version:
|
||||
|
||||
---Purpose: This class allows the definition of the type of a surface.
|
||||
-- Aspect attributes of a 3d face.
|
||||
-- Keywords: Material, FillArea, Shininess, Ambient, Color, Diffuse,
|
||||
-- Specular, Transparency, Emissive, ReflectionMode,
|
||||
-- BackFace, FrontFace, Reflection, Absorbtion
|
||||
|
||||
---Warning:
|
||||
---References:
|
||||
|
||||
uses
|
||||
|
||||
Color from Quantity,
|
||||
NameOfMaterial from Graphic3d,
|
||||
TypeOfReflection from Graphic3d,
|
||||
TypeOfMaterial from Graphic3d,
|
||||
BSDF from Graphic3d,
|
||||
AsciiString from TCollection
|
||||
|
||||
raises
|
||||
|
||||
MaterialDefinitionError from Graphic3d,
|
||||
OutOfRange from Standard
|
||||
|
||||
is
|
||||
|
||||
Create
|
||||
returns MaterialAspect from Graphic3d;
|
||||
---Level: Public
|
||||
---Purpose: Creates a material from default values.
|
||||
---Material is generic
|
||||
|
||||
Create ( AName : NameOfMaterial from Graphic3d )
|
||||
returns MaterialAspect from Graphic3d;
|
||||
---Level: Public
|
||||
---Purpose: Creates a generic material calls <AName>
|
||||
|
||||
---------------------------------------------------
|
||||
-- Category: Methods to modify the class definition
|
||||
---------------------------------------------------
|
||||
|
||||
IncreaseShine ( me : in out;
|
||||
ADelta : Real from Standard )
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Increases or decreases the luminosity of <me>.
|
||||
-- <ADelta> is a signed percentage.
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
SetAmbient ( me : in out;
|
||||
AValue : Real from Standard )
|
||||
---Level: Public
|
||||
---Purpose: Modifies the reflection properties of the surface.
|
||||
-- Category: Methods to modify the class definition
|
||||
-- Warning: Raises MaterialDefinitionError if <AValue> is
|
||||
-- a negative value or greater than 1.0.
|
||||
raises MaterialDefinitionError from Graphic3d is static;
|
||||
|
||||
SetDiffuse ( me : in out;
|
||||
AValue : Real from Standard )
|
||||
---Level: Public
|
||||
---Purpose: Modifies the reflection properties of the surface.
|
||||
-- Category: Methods to modify the class definition
|
||||
-- Warning: Raises MaterialDefinitionError if <AValue> is a
|
||||
-- negative value or greater than 1.0.
|
||||
raises MaterialDefinitionError from Graphic3d is static;
|
||||
|
||||
SetEmissive ( me : in out;
|
||||
AValue : Real from Standard )
|
||||
---Level: Public
|
||||
---Purpose: Modifies the reflection properties of the surface.
|
||||
-- Category: Methods to modify the class definition
|
||||
-- Warning: Raises MaterialDefinitionError if <AValue> is a
|
||||
-- negative value or greater than 1.0.
|
||||
raises MaterialDefinitionError from Graphic3d is static;
|
||||
|
||||
SetShininess ( me : in out;
|
||||
AValue : Real from Standard )
|
||||
---Level: Public
|
||||
---Purpose: Modifies the luminosity of the surface.
|
||||
-- Category: Methods to modify the class definition
|
||||
-- Warning: Raises MaterialDefinitionError if <AValue> is a
|
||||
-- negative value or greater than 1.0.
|
||||
raises MaterialDefinitionError from Graphic3d is static;
|
||||
|
||||
SetSpecular ( me : in out;
|
||||
AValue : Real from Standard )
|
||||
---Level: Public
|
||||
---Purpose: Modifies the reflection properties of the surface.
|
||||
-- Category: Methods to modify the class definition
|
||||
-- Warning: Raises MaterialDefinitionError if <AValue> is a
|
||||
-- negative value or greater than 1.0.
|
||||
raises MaterialDefinitionError from Graphic3d is static;
|
||||
|
||||
SetTransparency ( me : in out;
|
||||
AValue : Real from Standard )
|
||||
---Level: Public
|
||||
---Purpose: Modifies the transparency coefficient of the surface.
|
||||
-- <AValue> = 0. opaque. (default)
|
||||
-- <AValue> = 1. transparent.
|
||||
-- Transparency is applicable to materials that have at least
|
||||
-- one of reflection modes (ambient, diffuse, specular or emissive)
|
||||
-- enabled. See also SetReflectionModeOn() and SetReflectionModeOff() methods.
|
||||
--
|
||||
-- NOTE: In order for transparency specified through this method to
|
||||
-- take effect, it is necessary to enable transparency
|
||||
-- in the viewer. This can be done either directly -
|
||||
-- see Visual3d_ViewManager::SetTransparency(Standard_Boolean),
|
||||
-- or indirectly - by calling AIS_InteractiveObject::SetTransparency()
|
||||
-- before an object is added to an interactive context, or by
|
||||
-- calling AIS_InteractiveContext::SetTransparency() for a given
|
||||
-- interactive object already displayed.
|
||||
-- Category: Methods to modify the class definition
|
||||
-- Warning: Raises MaterialDefinitionError if <AValue> is a
|
||||
-- negative value or greater than 1.0.
|
||||
raises MaterialDefinitionError from Graphic3d is static;
|
||||
|
||||
SetRefractionIndex ( me : in out;
|
||||
theValue : Real from Standard )
|
||||
---Level: Public
|
||||
---Purpose: Modifies the refraction index of the material.
|
||||
-- Category: Methods to modify the class definition
|
||||
-- Warning: Raises MaterialDefinitionError if <theValue> is a
|
||||
-- lesser than 1.0.
|
||||
raises MaterialDefinitionError from Graphic3d is static;
|
||||
|
||||
SetBSDF ( me : in out;
|
||||
theBSDF : BSDF from Graphic3d )
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Modifies the BSDF (bidirectional scattering distribution function).
|
||||
-- Category: Methods to modify the class definition
|
||||
|
||||
SetColor ( me : in out;
|
||||
AColor : Color from Quantity )
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Modifies the ambient and diffuse colour of the surface.
|
||||
-- Category: Methods to modify the class definition
|
||||
|
||||
SetAmbientColor ( me : in out;
|
||||
AColor : Color from Quantity )
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Modifies the ambient colour of the surface.
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
SetDiffuseColor ( me : in out;
|
||||
AColor : Color from Quantity )
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Modifies the difuse colour of the surface.
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
SetSpecularColor ( me : in out;
|
||||
AColor : Color from Quantity )
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Modifies the specular colour of the surface.
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
SetEmissiveColor ( me : in out;
|
||||
AColor : Color from Quantity )
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Modifies the emissive colour of the surface.
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
|
||||
SetReflectionModeOn ( me : in out;
|
||||
AType : TypeOfReflection from Graphic3d )
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Activates the reflective properties of the surface <AType>.
|
||||
--
|
||||
-- TypeOfReflection : TOR_AMBIENT
|
||||
-- TOR_DIFFUSE
|
||||
-- TOR_SPECULAR
|
||||
-- TOR_EMISSION
|
||||
-- 1, 2, 3 or 4 types of reflection can be set for a given surface.
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
SetReflectionModeOff ( me : in out;
|
||||
AType : TypeOfReflection from Graphic3d )
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Deactivates the reflective properties of
|
||||
-- the surface <AType>.
|
||||
--
|
||||
-- TypeOfReflection : TOR_AMBIENT
|
||||
-- TOR_DIFFUSE
|
||||
-- TOR_SPECULAR
|
||||
-- TOR_EMISSION
|
||||
-- 1, 2, 3 or 4 types of reflection can be set off for a given surface.
|
||||
-- Disabling diffuse and specular reflectance is useful for efficient visualization
|
||||
-- of large amounts of data as definition of normals for graphic primitives is not needed
|
||||
-- when only "all-directional" reflectance is active.
|
||||
--
|
||||
-- NOTE: Disabling all four reflection modes also turns off the following effects:
|
||||
-- 1. Lighting. Colors of primitives are not affected by the material properties when lighting is off.
|
||||
-- 2. Transparency.
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
SetMaterialType ( me : in out;
|
||||
AType : TypeOfMaterial from Graphic3d )
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Set MyMaterialType to the value of parameter <AType>
|
||||
--
|
||||
-- TypeOfMaterial : MATERIAL_ASPECT
|
||||
-- MATERIAL_PHYSIC
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
SetMaterialName ( me : in out;
|
||||
AName : CString from Standard )
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: The current matarial become a "UserDefined" material.
|
||||
-- Set the name of the "UserDefined" material.
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
SetEnvReflexion(me : in out;
|
||||
AValue : ShortReal from Standard );
|
||||
|
||||
Reset(me : out);
|
||||
---Level: Public
|
||||
---Purpose: Resets the material with the original values according to
|
||||
-- the material name but leave the current color values untouched
|
||||
-- for the material of type ASPECT.
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
----------------------------
|
||||
-- Category: Inquire methods
|
||||
----------------------------
|
||||
|
||||
Color ( me )
|
||||
returns Color from Quantity
|
||||
is static;
|
||||
---C++: return const&
|
||||
---Level: Public
|
||||
---Purpose: Returns the diffuse colour of the surface.
|
||||
---Category: Inquire methods
|
||||
|
||||
AmbientColor ( me )
|
||||
returns Color from Quantity
|
||||
is static;
|
||||
---C++: return const&
|
||||
---Level: Public
|
||||
---Purpose: Returns the ambient colour of the surface.
|
||||
---Category: Inquire methods
|
||||
|
||||
DiffuseColor ( me )
|
||||
returns Color from Quantity
|
||||
is static;
|
||||
---C++: return const&
|
||||
---Level: Public
|
||||
---Purpose: Returns the diffuse colour of the surface.
|
||||
---Category: Inquire methods
|
||||
|
||||
SpecularColor ( me )
|
||||
returns Color from Quantity
|
||||
is static;
|
||||
---C++: return const&
|
||||
---Level: Public
|
||||
---Purpose: Returns the specular colour of the surface.
|
||||
---Category: Inquire methods
|
||||
|
||||
EmissiveColor ( me )
|
||||
returns Color from Quantity
|
||||
is static;
|
||||
---C++: return const&
|
||||
---Level: Public
|
||||
---Purpose: Returns the emissive colour of the surface.
|
||||
---Category: Inquire methods
|
||||
|
||||
Ambient ( me )
|
||||
returns Real from Standard
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns the reflection properties of the surface.
|
||||
---Category: Inquire methods
|
||||
|
||||
Diffuse ( me )
|
||||
returns Real from Standard
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns the reflection properties of the surface.
|
||||
---Category: Inquire methods
|
||||
|
||||
Specular ( me )
|
||||
returns Real from Standard
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns the reflection properties of the surface.
|
||||
---Category: Inquire methods
|
||||
|
||||
Transparency ( me )
|
||||
returns Real from Standard
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns the transparency coefficient of the surface.
|
||||
---Category: Inquire methods
|
||||
|
||||
RefractionIndex ( me )
|
||||
returns Real from Standard
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns the refraction index of the material
|
||||
---Category: Inquire methods
|
||||
|
||||
BSDF ( me )
|
||||
returns BSDF from Graphic3d
|
||||
is static;
|
||||
---C++: return const&
|
||||
---Level: Public
|
||||
---Purpose: Returns BSDF (bidirectional scattering distribution function).
|
||||
---Category: Inquire methods
|
||||
|
||||
Emissive ( me )
|
||||
returns Real from Standard
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns the emissive coefficient of the surface.
|
||||
---Category: Inquire methods
|
||||
|
||||
Shininess ( me )
|
||||
returns Real from Standard
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns the luminosity of the surface.
|
||||
---Category: Inquire methods
|
||||
|
||||
ReflectionMode ( me;
|
||||
AType : TypeOfReflection from Graphic3d )
|
||||
returns Boolean from Standard
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns Standard_True if the reflection mode is active,
|
||||
-- Standard_False otherwise.
|
||||
---Category: Inquire methods
|
||||
|
||||
MaterialType ( me;
|
||||
AType : TypeOfMaterial from Graphic3d )
|
||||
returns Boolean from Standard
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns Standard_True if MyMaterialType equal the parameter AType,
|
||||
-- Standard_False otherwise.
|
||||
---Category: Inquire methods
|
||||
|
||||
EnvReflexion(me)
|
||||
returns ShortReal from Standard;
|
||||
|
||||
Name(me)
|
||||
returns NameOfMaterial from Graphic3d;
|
||||
---Level: Public
|
||||
---Purpose: Returns the material name.
|
||||
---Category: Inquire methods
|
||||
|
||||
IsDifferent ( me;
|
||||
Other : MaterialAspect from Graphic3d )
|
||||
returns Boolean from Standard is static;
|
||||
---Purpose: Returns Standard_True if the materials <me> and
|
||||
-- <Other> are different.
|
||||
---Category: Inquire methods
|
||||
---C++: alias operator !=
|
||||
|
||||
IsEqual ( me;
|
||||
Other : MaterialAspect from Graphic3d )
|
||||
returns Boolean from Standard is static;
|
||||
---Purpose: Returns Standard_True if the materials <me> and
|
||||
-- <Other> are identical.
|
||||
---Category: Inquire methods
|
||||
---C++: alias operator ==
|
||||
|
||||
NumberOfMaterials(myclass) returns Integer from Standard;
|
||||
---Purpose:
|
||||
-- Returns the number of predefined textures.
|
||||
---Level: Public
|
||||
|
||||
MaterialName(myclass; aRank: Integer from Standard)
|
||||
returns CString from Standard
|
||||
raises OutOfRange from Standard;
|
||||
---Purpose:
|
||||
-- Returns the name of the predefined material of rank <aRank>
|
||||
-- Trigger: when <aRank> is < 1 or > NumberOfMaterials.
|
||||
---Level: Public
|
||||
|
||||
MaterialName(me)
|
||||
returns CString from Standard;
|
||||
---Purpose:
|
||||
-- Returns the name of this material
|
||||
---Level: Public
|
||||
|
||||
MaterialType(myclass; aRank: Integer from Standard)
|
||||
returns TypeOfMaterial from Graphic3d
|
||||
raises OutOfRange from Standard;
|
||||
---Purpose:
|
||||
-- Returns the type of the predefined material of rank <aRank>
|
||||
-- Trigger: when <aRank> is < 1 or > NumberOfMaterials.
|
||||
---Level: Public
|
||||
|
||||
MaterialFromName (myclass;
|
||||
theName : CString from Standard)
|
||||
returns NameOfMaterial from Graphic3d;
|
||||
---Purpose:
|
||||
-- Returns the material for specified name or Graphic3d_NOM_DEFAULT if name is unknown.
|
||||
|
||||
----------------------------
|
||||
-- Category: Private methods
|
||||
----------------------------
|
||||
|
||||
Init ( me : out; AName : NameOfMaterial from Graphic3d) is private;
|
||||
|
||||
--
|
||||
|
||||
fields
|
||||
|
||||
--
|
||||
-- Class : Graphic3d_MaterialAspect
|
||||
--
|
||||
-- purpose : Declaration of variables specific to the definition
|
||||
-- of materials.
|
||||
--
|
||||
-- Reminders : A material is defines by:
|
||||
-- - A coefficient of transparency
|
||||
-- - A coefficient of diffuse reflection
|
||||
-- - A coefficient of ambiant reflection
|
||||
-- - A coefficient of specular reflection
|
||||
-- - A emissive coefficient
|
||||
--
|
||||
-- Two properties define a material :
|
||||
-- - its transparency
|
||||
-- - its reflection which is to say its properties of
|
||||
-- - absorbtion and diffusion of light
|
||||
--
|
||||
-- The diffuse reflection is seen as a component
|
||||
-- of the colour of the object.
|
||||
-- The specular reflection is seen as a component
|
||||
-- of the colour of the light source
|
||||
--
|
||||
-- To determine the three colours of reflection,
|
||||
-- four things are required:
|
||||
-- - A coefficient of diffuse reflection
|
||||
-- - A coefficient of ambiant reflection
|
||||
-- - A coefficient of specular reflection
|
||||
--
|
||||
-- ( Under GL, the Silicon graphics interface,
|
||||
-- we need to determine 3 colours )
|
||||
--
|
||||
-- References : Getting started with DEC PHIGS, appendix C
|
||||
-- Iris Advanced Graphics, unit D
|
||||
--
|
||||
--
|
||||
-- the coefficient of diffuse reflection, the colour, and the activity
|
||||
myDiffuseCoef : ShortReal from Standard;
|
||||
myDiffuseColor : Color from Quantity;
|
||||
myDiffuseActivity : Boolean from Standard;
|
||||
|
||||
-- the coefficient of ambient reflection, the colour and the activity
|
||||
myAmbientCoef : ShortReal from Standard;
|
||||
myAmbientColor : Color from Quantity;
|
||||
myAmbientActivity : Boolean from Standard;
|
||||
|
||||
-- the coefficient of specular reflection, the colour and the activity
|
||||
mySpecularCoef : ShortReal from Standard;
|
||||
mySpecularColor : Color from Quantity;
|
||||
mySpecularActivity : Boolean from Standard;
|
||||
|
||||
-- the coefficient of emissive reflection
|
||||
myEmissiveCoef : ShortReal from Standard;
|
||||
myEmissiveColor : Color from Quantity;
|
||||
myEmissiveActivity : Boolean from Standard;
|
||||
|
||||
-- the coefficient of transparency and refraction index
|
||||
myTransparencyCoef : ShortReal from Standard;
|
||||
myRefractionIndex : ShortReal from Standard;
|
||||
|
||||
-- BSDF (bidirectional scattering distribution function). Physically based material represented as weighted mixture of BxDFs (BRDFs and BTDFs) and its parameters.
|
||||
myBSDF : BSDF from Graphic3d;
|
||||
|
||||
-- the specular exponent
|
||||
myShininess : ShortReal from Standard;
|
||||
|
||||
-- the coeficient of reflexion for the environment texture
|
||||
myEnvReflexion : ShortReal from Standard;
|
||||
|
||||
-- the type of material
|
||||
myMaterialType : TypeOfMaterial from Graphic3d;
|
||||
|
||||
-- the Name of material
|
||||
myMaterialName : NameOfMaterial from Graphic3d;
|
||||
myRequestedMaterialName : NameOfMaterial from Graphic3d;
|
||||
|
||||
-- the string name of the material
|
||||
myStringName : AsciiString from TCollection;
|
||||
|
||||
end MaterialAspect;
|
@@ -12,8 +12,12 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Graphic3d_MaterialAspect.ixx>
|
||||
|
||||
#include <Graphic3d_MaterialAspect.hxx>
|
||||
#include <Graphic3d_MaterialDefinitionError.hxx>
|
||||
#include <Quantity_Color.hxx>
|
||||
#include <Standard_Assert.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
|
||||
// =======================================================================
|
||||
// function : Graphic3d_MaterialAspect
|
||||
|
316
src/Graphic3d/Graphic3d_MaterialAspect.hxx
Normal file
316
src/Graphic3d/Graphic3d_MaterialAspect.hxx
Normal file
@@ -0,0 +1,316 @@
|
||||
// Created by: NW,JPB,CAL
|
||||
// Copyright (c) 1991-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 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 License 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_MaterialAspect_HeaderFile
|
||||
#define _Graphic3d_MaterialAspect_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_ShortReal.hxx>
|
||||
#include <Quantity_Color.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Graphic3d_BSDF.hxx>
|
||||
#include <Graphic3d_TypeOfMaterial.hxx>
|
||||
#include <Graphic3d_NameOfMaterial.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Graphic3d_TypeOfReflection.hxx>
|
||||
#include <Standard_CString.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
class Graphic3d_MaterialDefinitionError;
|
||||
class Standard_OutOfRange;
|
||||
class Quantity_Color;
|
||||
|
||||
|
||||
//! This class allows the definition of the type of a surface.
|
||||
//! Aspect attributes of a 3d face.
|
||||
//! Keywords: Material, FillArea, Shininess, Ambient, Color, Diffuse,
|
||||
//! Specular, Transparency, Emissive, ReflectionMode,
|
||||
//! BackFace, FrontFace, Reflection, Absorbtion
|
||||
class Graphic3d_MaterialAspect
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Creates a material from default values.
|
||||
Standard_EXPORT Graphic3d_MaterialAspect();
|
||||
|
||||
//! Creates a generic material calls <AName>
|
||||
Standard_EXPORT Graphic3d_MaterialAspect(const Graphic3d_NameOfMaterial AName);
|
||||
|
||||
//! Increases or decreases the luminosity of <me>.
|
||||
//! <ADelta> is a signed percentage.
|
||||
Standard_EXPORT void IncreaseShine (const Standard_Real ADelta);
|
||||
|
||||
//! Modifies the reflection properties of the surface.
|
||||
//! Category: Methods to modify the class definition
|
||||
//! Warning: Raises MaterialDefinitionError if <AValue> is
|
||||
//! a negative value or greater than 1.0.
|
||||
Standard_EXPORT void SetAmbient (const Standard_Real AValue);
|
||||
|
||||
//! Modifies the reflection properties of the surface.
|
||||
//! Category: Methods to modify the class definition
|
||||
//! Warning: Raises MaterialDefinitionError if <AValue> is a
|
||||
//! negative value or greater than 1.0.
|
||||
Standard_EXPORT void SetDiffuse (const Standard_Real AValue);
|
||||
|
||||
//! Modifies the reflection properties of the surface.
|
||||
//! Category: Methods to modify the class definition
|
||||
//! Warning: Raises MaterialDefinitionError if <AValue> is a
|
||||
//! negative value or greater than 1.0.
|
||||
Standard_EXPORT void SetEmissive (const Standard_Real AValue);
|
||||
|
||||
//! Modifies the luminosity of the surface.
|
||||
//! Category: Methods to modify the class definition
|
||||
//! Warning: Raises MaterialDefinitionError if <AValue> is a
|
||||
//! negative value or greater than 1.0.
|
||||
Standard_EXPORT void SetShininess (const Standard_Real AValue);
|
||||
|
||||
//! Modifies the reflection properties of the surface.
|
||||
//! Category: Methods to modify the class definition
|
||||
//! Warning: Raises MaterialDefinitionError if <AValue> is a
|
||||
//! negative value or greater than 1.0.
|
||||
Standard_EXPORT void SetSpecular (const Standard_Real AValue);
|
||||
|
||||
//! Modifies the transparency coefficient of the surface.
|
||||
//! <AValue> = 0. opaque. (default)
|
||||
//! <AValue> = 1. transparent.
|
||||
//! Transparency is applicable to materials that have at least
|
||||
//! one of reflection modes (ambient, diffuse, specular or emissive)
|
||||
//! enabled. See also SetReflectionModeOn() and SetReflectionModeOff() methods.
|
||||
//!
|
||||
//! NOTE: In order for transparency specified through this method to
|
||||
//! take effect, it is necessary to enable transparency
|
||||
//! in the viewer. This can be done either directly -
|
||||
//! see Visual3d_ViewManager::SetTransparency(Standard_Boolean),
|
||||
//! or indirectly - by calling AIS_InteractiveObject::SetTransparency()
|
||||
//! before an object is added to an interactive context, or by
|
||||
//! calling AIS_InteractiveContext::SetTransparency() for a given
|
||||
//! interactive object already displayed.
|
||||
//! Category: Methods to modify the class definition
|
||||
//! Warning: Raises MaterialDefinitionError if <AValue> is a
|
||||
//! negative value or greater than 1.0.
|
||||
Standard_EXPORT void SetTransparency (const Standard_Real AValue);
|
||||
|
||||
//! Modifies the refraction index of the material.
|
||||
//! Category: Methods to modify the class definition
|
||||
//! Warning: Raises MaterialDefinitionError if <theValue> is a
|
||||
//! lesser than 1.0.
|
||||
Standard_EXPORT void SetRefractionIndex (const Standard_Real theValue);
|
||||
|
||||
//! Modifies the BSDF (bidirectional scattering distribution function).
|
||||
//! Category: Methods to modify the class definition
|
||||
Standard_EXPORT void SetBSDF (const Graphic3d_BSDF& theBSDF);
|
||||
|
||||
//! Modifies the ambient and diffuse colour of the surface.
|
||||
//! Category: Methods to modify the class definition
|
||||
Standard_EXPORT void SetColor (const Quantity_Color& AColor);
|
||||
|
||||
//! Modifies the ambient colour of the surface.
|
||||
Standard_EXPORT void SetAmbientColor (const Quantity_Color& AColor);
|
||||
|
||||
//! Modifies the difuse colour of the surface.
|
||||
Standard_EXPORT void SetDiffuseColor (const Quantity_Color& AColor);
|
||||
|
||||
//! Modifies the specular colour of the surface.
|
||||
Standard_EXPORT void SetSpecularColor (const Quantity_Color& AColor);
|
||||
|
||||
//! Modifies the emissive colour of the surface.
|
||||
Standard_EXPORT void SetEmissiveColor (const Quantity_Color& AColor);
|
||||
|
||||
//! Activates the reflective properties of the surface <AType>.
|
||||
//!
|
||||
//! TypeOfReflection : TOR_AMBIENT
|
||||
//! TOR_DIFFUSE
|
||||
//! TOR_SPECULAR
|
||||
//! TOR_EMISSION
|
||||
//! 1, 2, 3 or 4 types of reflection can be set for a given surface.
|
||||
Standard_EXPORT void SetReflectionModeOn (const Graphic3d_TypeOfReflection AType);
|
||||
|
||||
//! Deactivates the reflective properties of
|
||||
//! the surface <AType>.
|
||||
//!
|
||||
//! TypeOfReflection : TOR_AMBIENT
|
||||
//! TOR_DIFFUSE
|
||||
//! TOR_SPECULAR
|
||||
//! TOR_EMISSION
|
||||
//! 1, 2, 3 or 4 types of reflection can be set off for a given surface.
|
||||
//! Disabling diffuse and specular reflectance is useful for efficient visualization
|
||||
//! of large amounts of data as definition of normals for graphic primitives is not needed
|
||||
//! when only "all-directional" reflectance is active.
|
||||
//!
|
||||
//! NOTE: Disabling all four reflection modes also turns off the following effects:
|
||||
//! 1. Lighting. Colors of primitives are not affected by the material properties when lighting is off.
|
||||
//! 2. Transparency.
|
||||
Standard_EXPORT void SetReflectionModeOff (const Graphic3d_TypeOfReflection AType);
|
||||
|
||||
//! Set MyMaterialType to the value of parameter <AType>
|
||||
//!
|
||||
//! TypeOfMaterial : MATERIAL_ASPECT
|
||||
//! MATERIAL_PHYSIC
|
||||
Standard_EXPORT void SetMaterialType (const Graphic3d_TypeOfMaterial AType);
|
||||
|
||||
//! The current matarial become a "UserDefined" material.
|
||||
//! Set the name of the "UserDefined" material.
|
||||
Standard_EXPORT void SetMaterialName (const Standard_CString AName);
|
||||
|
||||
Standard_EXPORT void SetEnvReflexion (const Standard_ShortReal AValue);
|
||||
|
||||
//! Resets the material with the original values according to
|
||||
//! the material name but leave the current color values untouched
|
||||
//! for the material of type ASPECT.
|
||||
Standard_EXPORT void Reset();
|
||||
|
||||
//! Returns the diffuse colour of the surface.
|
||||
Standard_EXPORT const Quantity_Color& Color() const;
|
||||
|
||||
//! Returns the ambient colour of the surface.
|
||||
Standard_EXPORT const Quantity_Color& AmbientColor() const;
|
||||
|
||||
//! Returns the diffuse colour of the surface.
|
||||
Standard_EXPORT const Quantity_Color& DiffuseColor() const;
|
||||
|
||||
//! Returns the specular colour of the surface.
|
||||
Standard_EXPORT const Quantity_Color& SpecularColor() const;
|
||||
|
||||
//! Returns the emissive colour of the surface.
|
||||
Standard_EXPORT const Quantity_Color& EmissiveColor() const;
|
||||
|
||||
//! Returns the reflection properties of the surface.
|
||||
Standard_EXPORT Standard_Real Ambient() const;
|
||||
|
||||
//! Returns the reflection properties of the surface.
|
||||
Standard_EXPORT Standard_Real Diffuse() const;
|
||||
|
||||
//! Returns the reflection properties of the surface.
|
||||
Standard_EXPORT Standard_Real Specular() const;
|
||||
|
||||
//! Returns the transparency coefficient of the surface.
|
||||
Standard_EXPORT Standard_Real Transparency() const;
|
||||
|
||||
//! Returns the refraction index of the material
|
||||
Standard_EXPORT Standard_Real RefractionIndex() const;
|
||||
|
||||
//! Returns BSDF (bidirectional scattering distribution function).
|
||||
Standard_EXPORT const Graphic3d_BSDF& BSDF() const;
|
||||
|
||||
//! Returns the emissive coefficient of the surface.
|
||||
Standard_EXPORT Standard_Real Emissive() const;
|
||||
|
||||
//! Returns the luminosity of the surface.
|
||||
Standard_EXPORT Standard_Real Shininess() const;
|
||||
|
||||
//! Returns Standard_True if the reflection mode is active,
|
||||
//! Standard_False otherwise.
|
||||
Standard_EXPORT Standard_Boolean ReflectionMode (const Graphic3d_TypeOfReflection AType) const;
|
||||
|
||||
//! Returns Standard_True if MyMaterialType equal the parameter AType,
|
||||
//! Standard_False otherwise.
|
||||
Standard_EXPORT Standard_Boolean MaterialType (const Graphic3d_TypeOfMaterial AType) const;
|
||||
|
||||
Standard_EXPORT Standard_ShortReal EnvReflexion() const;
|
||||
|
||||
//! Returns the material name.
|
||||
Standard_EXPORT Graphic3d_NameOfMaterial Name() const;
|
||||
|
||||
//! Returns Standard_True if the materials <me> and
|
||||
//! <Other> are different.
|
||||
Standard_EXPORT Standard_Boolean IsDifferent (const Graphic3d_MaterialAspect& Other) const;
|
||||
Standard_Boolean operator != (const Graphic3d_MaterialAspect& Other) const
|
||||
{
|
||||
return IsDifferent(Other);
|
||||
}
|
||||
|
||||
//! Returns Standard_True if the materials <me> and
|
||||
//! <Other> are identical.
|
||||
Standard_EXPORT Standard_Boolean IsEqual (const Graphic3d_MaterialAspect& Other) const;
|
||||
Standard_Boolean operator == (const Graphic3d_MaterialAspect& Other) const
|
||||
{
|
||||
return IsEqual(Other);
|
||||
}
|
||||
|
||||
|
||||
//! Returns the number of predefined textures.
|
||||
Standard_EXPORT static Standard_Integer NumberOfMaterials();
|
||||
|
||||
|
||||
//! Returns the name of the predefined material of rank <aRank>
|
||||
//! Trigger: when <aRank> is < 1 or > NumberOfMaterials.
|
||||
Standard_EXPORT static Standard_CString MaterialName (const Standard_Integer aRank);
|
||||
|
||||
|
||||
//! Returns the name of this material
|
||||
Standard_EXPORT Standard_CString MaterialName() const;
|
||||
|
||||
|
||||
//! Returns the type of the predefined material of rank <aRank>
|
||||
//! Trigger: when <aRank> is < 1 or > NumberOfMaterials.
|
||||
Standard_EXPORT static Graphic3d_TypeOfMaterial MaterialType (const Standard_Integer aRank);
|
||||
|
||||
|
||||
//! Returns the material for specified name or Graphic3d_NOM_DEFAULT if name is unknown.
|
||||
Standard_EXPORT static Graphic3d_NameOfMaterial MaterialFromName (const Standard_CString theName);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT void Init (const Graphic3d_NameOfMaterial AName);
|
||||
|
||||
|
||||
Standard_ShortReal myDiffuseCoef;
|
||||
Quantity_Color myDiffuseColor;
|
||||
Standard_Boolean myDiffuseActivity;
|
||||
Standard_ShortReal myAmbientCoef;
|
||||
Quantity_Color myAmbientColor;
|
||||
Standard_Boolean myAmbientActivity;
|
||||
Standard_ShortReal mySpecularCoef;
|
||||
Quantity_Color mySpecularColor;
|
||||
Standard_Boolean mySpecularActivity;
|
||||
Standard_ShortReal myEmissiveCoef;
|
||||
Quantity_Color myEmissiveColor;
|
||||
Standard_Boolean myEmissiveActivity;
|
||||
Standard_ShortReal myTransparencyCoef;
|
||||
Standard_ShortReal myRefractionIndex;
|
||||
Graphic3d_BSDF myBSDF;
|
||||
Standard_ShortReal myShininess;
|
||||
Standard_ShortReal myEnvReflexion;
|
||||
Graphic3d_TypeOfMaterial myMaterialType;
|
||||
Graphic3d_NameOfMaterial myMaterialName;
|
||||
Graphic3d_NameOfMaterial myRequestedMaterialName;
|
||||
TCollection_AsciiString myStringName;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Graphic3d_MaterialAspect_HeaderFile
|
37
src/Graphic3d/Graphic3d_MaterialDefinitionError.hxx
Normal file
37
src/Graphic3d/Graphic3d_MaterialDefinitionError.hxx
Normal file
@@ -0,0 +1,37 @@
|
||||
// Created on: 1993-03-31
|
||||
// Created by: NW,JPB,CAL
|
||||
// Copyright (c) 1993-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 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 License 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_MaterialDefinitionError_HeaderFile
|
||||
#define _Graphic3d_MaterialDefinitionError_HeaderFile
|
||||
|
||||
#include <Standard_Type.hxx>
|
||||
#include <Standard_DefineException.hxx>
|
||||
#include <Standard_SStream.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
|
||||
class Graphic3d_MaterialDefinitionError;
|
||||
DEFINE_STANDARD_HANDLE(Graphic3d_MaterialDefinitionError, Standard_OutOfRange)
|
||||
|
||||
#if !defined No_Exception && !defined No_Graphic3d_MaterialDefinitionError
|
||||
#define Graphic3d_MaterialDefinitionError_Raise_if(CONDITION, MESSAGE) \
|
||||
if (CONDITION) Graphic3d_MaterialDefinitionError::Raise(MESSAGE);
|
||||
#else
|
||||
#define Graphic3d_MaterialDefinitionError_Raise_if(CONDITION, MESSAGE)
|
||||
#endif
|
||||
|
||||
DEFINE_STANDARD_EXCEPTION(Graphic3d_MaterialDefinitionError, Standard_OutOfRange)
|
||||
|
||||
#endif // _Graphic3d_MaterialDefinitionError_HeaderFile
|
50
src/Graphic3d/Graphic3d_NameOfMaterial.hxx
Normal file
50
src/Graphic3d/Graphic3d_NameOfMaterial.hxx
Normal file
@@ -0,0 +1,50 @@
|
||||
// Created on: 1993-03-31
|
||||
// Created by: NW,JPB,CAL
|
||||
// Copyright (c) 1993-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 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 License 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_NameOfMaterial_HeaderFile
|
||||
#define _Graphic3d_NameOfMaterial_HeaderFile
|
||||
|
||||
//! Types of aspect materials.
|
||||
enum Graphic3d_NameOfMaterial
|
||||
{
|
||||
Graphic3d_NOM_BRASS,
|
||||
Graphic3d_NOM_BRONZE,
|
||||
Graphic3d_NOM_COPPER,
|
||||
Graphic3d_NOM_GOLD,
|
||||
Graphic3d_NOM_PEWTER,
|
||||
Graphic3d_NOM_PLASTER,
|
||||
Graphic3d_NOM_PLASTIC,
|
||||
Graphic3d_NOM_SILVER,
|
||||
Graphic3d_NOM_STEEL,
|
||||
Graphic3d_NOM_STONE,
|
||||
Graphic3d_NOM_SHINY_PLASTIC,
|
||||
Graphic3d_NOM_SATIN,
|
||||
Graphic3d_NOM_METALIZED,
|
||||
Graphic3d_NOM_NEON_GNC,
|
||||
Graphic3d_NOM_CHROME,
|
||||
Graphic3d_NOM_ALUMINIUM,
|
||||
Graphic3d_NOM_OBSIDIAN,
|
||||
Graphic3d_NOM_NEON_PHC,
|
||||
Graphic3d_NOM_JADE,
|
||||
Graphic3d_NOM_CHARCOAL,
|
||||
Graphic3d_NOM_WATER,
|
||||
Graphic3d_NOM_GLASS,
|
||||
Graphic3d_NOM_DIAMOND,
|
||||
Graphic3d_NOM_DEFAULT,
|
||||
Graphic3d_NOM_UserDefined
|
||||
};
|
||||
|
||||
#endif // _Graphic3d_NameOfMaterial_HeaderFile
|
27
src/Graphic3d/Graphic3d_NameOfTexture1D.hxx
Normal file
27
src/Graphic3d/Graphic3d_NameOfTexture1D.hxx
Normal file
@@ -0,0 +1,27 @@
|
||||
// Created on: 1993-03-31
|
||||
// Created by: NW,JPB,CAL
|
||||
// Copyright (c) 1993-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 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 License 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_NameOfTexture1D_HeaderFile
|
||||
#define _Graphic3d_NameOfTexture1D_HeaderFile
|
||||
|
||||
//! Types of standard textures.
|
||||
enum Graphic3d_NameOfTexture1D
|
||||
{
|
||||
Graphic3d_NOT_1D_ELEVATION,
|
||||
Graphic3d_NOT_1D_UNKNOWN
|
||||
};
|
||||
|
||||
#endif // _Graphic3d_NameOfTexture1D_HeaderFile
|
47
src/Graphic3d/Graphic3d_NameOfTexture2D.hxx
Normal file
47
src/Graphic3d/Graphic3d_NameOfTexture2D.hxx
Normal file
@@ -0,0 +1,47 @@
|
||||
// Created on: 1993-03-31
|
||||
// Created by: NW,JPB,CAL
|
||||
// Copyright (c) 1993-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 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 License 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_NameOfTexture2D_HeaderFile
|
||||
#define _Graphic3d_NameOfTexture2D_HeaderFile
|
||||
|
||||
//! Types of standard textures.
|
||||
enum Graphic3d_NameOfTexture2D
|
||||
{
|
||||
Graphic3d_NOT_2D_MATRA,
|
||||
Graphic3d_NOT_2D_ALIENSKIN,
|
||||
Graphic3d_NOT_2D_BLUE_ROCK,
|
||||
Graphic3d_NOT_2D_BLUEWHITE_PAPER,
|
||||
Graphic3d_NOT_2D_BRUSHED,
|
||||
Graphic3d_NOT_2D_BUBBLES,
|
||||
Graphic3d_NOT_2D_BUMP,
|
||||
Graphic3d_NOT_2D_CAST,
|
||||
Graphic3d_NOT_2D_CHIPBD,
|
||||
Graphic3d_NOT_2D_CLOUDS,
|
||||
Graphic3d_NOT_2D_FLESH,
|
||||
Graphic3d_NOT_2D_FLOOR,
|
||||
Graphic3d_NOT_2D_GALVNISD,
|
||||
Graphic3d_NOT_2D_GRASS,
|
||||
Graphic3d_NOT_2D_ALUMINUM,
|
||||
Graphic3d_NOT_2D_ROCK,
|
||||
Graphic3d_NOT_2D_KNURL,
|
||||
Graphic3d_NOT_2D_MAPLE,
|
||||
Graphic3d_NOT_2D_MARBLE,
|
||||
Graphic3d_NOT_2D_MOTTLED,
|
||||
Graphic3d_NOT_2D_RAIN,
|
||||
Graphic3d_NOT_2D_UNKNOWN
|
||||
};
|
||||
|
||||
#endif // _Graphic3d_NameOfTexture2D_HeaderFile
|
34
src/Graphic3d/Graphic3d_NameOfTextureEnv.hxx
Normal file
34
src/Graphic3d/Graphic3d_NameOfTextureEnv.hxx
Normal file
@@ -0,0 +1,34 @@
|
||||
// Created on: 1993-03-31
|
||||
// Created by: NW,JPB,CAL
|
||||
// Copyright (c) 1993-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 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 License 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_NameOfTextureEnv_HeaderFile
|
||||
#define _Graphic3d_NameOfTextureEnv_HeaderFile
|
||||
|
||||
//! Types of standard textures.
|
||||
enum Graphic3d_NameOfTextureEnv
|
||||
{
|
||||
Graphic3d_NOT_ENV_CLOUDS,
|
||||
Graphic3d_NOT_ENV_CV,
|
||||
Graphic3d_NOT_ENV_MEDIT,
|
||||
Graphic3d_NOT_ENV_PEARL,
|
||||
Graphic3d_NOT_ENV_SKY1,
|
||||
Graphic3d_NOT_ENV_SKY2,
|
||||
Graphic3d_NOT_ENV_LINES,
|
||||
Graphic3d_NOT_ENV_ROAD,
|
||||
Graphic3d_NOT_ENV_UNKNOWN
|
||||
};
|
||||
|
||||
#endif // _Graphic3d_NameOfTextureEnv_HeaderFile
|
29
src/Graphic3d/Graphic3d_NameOfTexturePlane.hxx
Normal file
29
src/Graphic3d/Graphic3d_NameOfTexturePlane.hxx
Normal file
@@ -0,0 +1,29 @@
|
||||
// Created on: 1993-03-31
|
||||
// Created by: NW,JPB,CAL
|
||||
// Copyright (c) 1993-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 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 License 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_NameOfTexturePlane_HeaderFile
|
||||
#define _Graphic3d_NameOfTexturePlane_HeaderFile
|
||||
|
||||
//! Type of the texture projection plane for both S and T texture coordinate.
|
||||
enum Graphic3d_NameOfTexturePlane
|
||||
{
|
||||
Graphic3d_NOTP_XY,
|
||||
Graphic3d_NOTP_YZ,
|
||||
Graphic3d_NOTP_ZX,
|
||||
Graphic3d_NOTP_UNKNOWN
|
||||
};
|
||||
|
||||
#endif // _Graphic3d_NameOfTexturePlane_HeaderFile
|
37
src/Graphic3d/Graphic3d_PriorityDefinitionError.hxx
Normal file
37
src/Graphic3d/Graphic3d_PriorityDefinitionError.hxx
Normal file
@@ -0,0 +1,37 @@
|
||||
// Created on: 1993-03-31
|
||||
// Created by: NW,JPB,CAL
|
||||
// Copyright (c) 1993-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 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 License 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_PriorityDefinitionError_HeaderFile
|
||||
#define _Graphic3d_PriorityDefinitionError_HeaderFile
|
||||
|
||||
#include <Standard_Type.hxx>
|
||||
#include <Standard_DefineException.hxx>
|
||||
#include <Standard_SStream.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
|
||||
class Graphic3d_PriorityDefinitionError;
|
||||
DEFINE_STANDARD_HANDLE(Graphic3d_PriorityDefinitionError, Standard_OutOfRange)
|
||||
|
||||
#if !defined No_Exception && !defined No_Graphic3d_PriorityDefinitionError
|
||||
#define Graphic3d_PriorityDefinitionError_Raise_if(CONDITION, MESSAGE) \
|
||||
if (CONDITION) Graphic3d_PriorityDefinitionError::Raise(MESSAGE);
|
||||
#else
|
||||
#define Graphic3d_PriorityDefinitionError_Raise_if(CONDITION, MESSAGE)
|
||||
#endif
|
||||
|
||||
DEFINE_STANDARD_EXCEPTION(Graphic3d_PriorityDefinitionError, Standard_OutOfRange)
|
||||
|
||||
#endif // _Graphic3d_PriorityDefinitionError_HeaderFile
|
29
src/Graphic3d/Graphic3d_RenderingMode.hxx
Normal file
29
src/Graphic3d/Graphic3d_RenderingMode.hxx
Normal file
@@ -0,0 +1,29 @@
|
||||
// Created on: 1993-03-31
|
||||
// Created by: NW,JPB,CAL
|
||||
// Copyright (c) 1993-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 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 License 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_RenderingMode_HeaderFile
|
||||
#define _Graphic3d_RenderingMode_HeaderFile
|
||||
|
||||
//! Describes rendering modes.
|
||||
//! - RM_RASTERIZATION: enables OpenGL rasterization mode;
|
||||
//! - RM_RAYTRACING: enables GPU ray-tracing mode.
|
||||
enum Graphic3d_RenderingMode
|
||||
{
|
||||
Graphic3d_RM_RASTERIZATION,
|
||||
Graphic3d_RM_RAYTRACING
|
||||
};
|
||||
|
||||
#endif // _Graphic3d_RenderingMode_HeaderFile
|
27
src/Graphic3d/Graphic3d_SortType.hxx
Normal file
27
src/Graphic3d/Graphic3d_SortType.hxx
Normal file
@@ -0,0 +1,27 @@
|
||||
// Created on: 1993-03-31
|
||||
// Created by: NW,JPB,CAL
|
||||
// Copyright (c) 1993-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 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 License 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_SortType_HeaderFile
|
||||
#define _Graphic3d_SortType_HeaderFile
|
||||
|
||||
|
||||
enum Graphic3d_SortType
|
||||
{
|
||||
Graphic3d_ST_Simple,
|
||||
Graphic3d_ST_BSP_Tree
|
||||
};
|
||||
|
||||
#endif // _Graphic3d_SortType_HeaderFile
|
File diff suppressed because it is too large
Load Diff
@@ -13,23 +13,33 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Graphic3d_Structure.ixx>
|
||||
#include <Graphic3d_Structure.pxx>
|
||||
|
||||
#include <Graphic3d_GraphicDriver.hxx>
|
||||
#include <Graphic3d_MaterialAspect.hxx>
|
||||
|
||||
#include <Graphic3d_MapOfStructure.hxx>
|
||||
#include <Graphic3d_MapIteratorOfMapOfStructure.hxx>
|
||||
|
||||
#include <Quantity_Color.hxx>
|
||||
#include <TColStd_Array2OfReal.hxx>
|
||||
#include <Graphic3d_TextureMap.hxx>
|
||||
|
||||
#include <Aspect_PolygonOffsetMode.hxx>
|
||||
#include <Bnd_Box.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <Graphic3d_AspectFillArea3d.hxx>
|
||||
#include <Graphic3d_AspectLine3d.hxx>
|
||||
#include <Graphic3d_AspectMarker3d.hxx>
|
||||
#include <Graphic3d_AspectText3d.hxx>
|
||||
#include <Graphic3d_DataStructureManager.hxx>
|
||||
#include <Graphic3d_GraphicDriver.hxx>
|
||||
#include <Graphic3d_Group.hxx>
|
||||
#include <Graphic3d_MapIteratorOfMapOfStructure.hxx>
|
||||
#include <Graphic3d_MapOfStructure.hxx>
|
||||
#include <Graphic3d_MaterialAspect.hxx>
|
||||
#include <Graphic3d_PriorityDefinitionError.hxx>
|
||||
#include <Graphic3d_Structure.hxx>
|
||||
#include <Graphic3d_Structure.pxx>
|
||||
#include <Graphic3d_StructureDefinitionError.hxx>
|
||||
#include <Graphic3d_StructureManager.hxx>
|
||||
#include <Graphic3d_TextureMap.hxx>
|
||||
#include <Graphic3d_TransformError.hxx>
|
||||
#include <Graphic3d_Vector.hxx>
|
||||
#include <Quantity_Color.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TColStd_Array2OfReal.hxx>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
//=============================================================================
|
||||
//function : Graphic3d_Structure
|
||||
//purpose :
|
||||
|
569
src/Graphic3d/Graphic3d_Structure.hxx
Normal file
569
src/Graphic3d/Graphic3d_Structure.hxx
Normal file
@@ -0,0 +1,569 @@
|
||||
// Created on: 1991-06-12
|
||||
// Created by: NW,JPB,CAL
|
||||
// Copyright (c) 1991-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 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 License 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_Structure_HeaderFile
|
||||
#define _Graphic3d_Structure_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Graphic3d_CStructure.hxx>
|
||||
#include <Graphic3d_IndexedMapOfAddress.hxx>
|
||||
#include <Quantity_Color.hxx>
|
||||
#include <Aspect_TypeOfHighlightMethod.hxx>
|
||||
#include <Graphic3d_StructureManagerPtr.hxx>
|
||||
#include <Standard_Address.hxx>
|
||||
#include <Graphic3d_TypeOfStructure.hxx>
|
||||
#include <MMgt_TShared.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Graphic3d_ZLayerId.hxx>
|
||||
#include <Graphic3d_SequenceOfHClipPlane.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <TColStd_Array2OfReal.hxx>
|
||||
#include <Graphic3d_SequenceOfGroup.hxx>
|
||||
#include <Graphic3d_TypeOfConnection.hxx>
|
||||
#include <Graphic3d_MapOfStructure.hxx>
|
||||
#include <Graphic3d_TypeOfComposition.hxx>
|
||||
#include <Graphic3d_TransModeFlags.hxx>
|
||||
#include <Graphic3d_BndBox4f.hxx>
|
||||
#include <Graphic3d_BndBox4d.hxx>
|
||||
#include <Graphic3d_Vertex.hxx>
|
||||
class Graphic3d_PriorityDefinitionError;
|
||||
class Graphic3d_StructureDefinitionError;
|
||||
class Graphic3d_TransformError;
|
||||
class Graphic3d_Group;
|
||||
class Graphic3d_StructureManager;
|
||||
class Quantity_Color;
|
||||
class Graphic3d_AspectLine3d;
|
||||
class Graphic3d_AspectFillArea3d;
|
||||
class Graphic3d_AspectText3d;
|
||||
class Graphic3d_AspectMarker3d;
|
||||
class Graphic3d_DataStructureManager;
|
||||
class Bnd_Box;
|
||||
class gp_Pnt;
|
||||
class Graphic3d_Vector;
|
||||
|
||||
|
||||
class Graphic3d_Structure;
|
||||
DEFINE_STANDARD_HANDLE(Graphic3d_Structure, MMgt_TShared)
|
||||
|
||||
//! This class allows the definition a graphic object.
|
||||
//! This graphic structure can be displayed,
|
||||
//! erased, or highlighted.
|
||||
//! This graphic structure can be connected with
|
||||
//! another graphic structure.
|
||||
//! Keywords: Structure, StructureManager, Display, Erase, Highlight,
|
||||
//! UnHighlight, Visible, Priority, Selectable, Visible,
|
||||
//! Visual, Connection, Ancestors, Descendants, Transformation
|
||||
class Graphic3d_Structure : public MMgt_TShared
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates a graphic object in the manager theManager.
|
||||
//! It will appear in all the views of the visualiser.
|
||||
//! Warning: The default values AspectLine, AspectFillArea, AspectText and AspectMarker are NOT applied to the structure.
|
||||
//! The structure is not displayed when it is created.
|
||||
Standard_EXPORT Graphic3d_Structure(const Handle(Graphic3d_StructureManager)& theManager);
|
||||
|
||||
//! Creates a shadow link to existing graphic object.
|
||||
Standard_EXPORT Graphic3d_Structure(const Handle(Graphic3d_StructureManager)& theManager, const Handle(Graphic3d_Structure)& thePrs);
|
||||
|
||||
//! if WithDestruction == Standard_True then
|
||||
//! suppress all the groups of primitives in the structure.
|
||||
//! and it is mandatory to create a new group in <me>.
|
||||
//! if WithDestruction == Standard_False then
|
||||
//! clears all the groups of primitives in the structure.
|
||||
//! and all the groups are conserved and empty.
|
||||
//! They will be erased at the next screen update.
|
||||
//! The structure itself is conserved.
|
||||
//! The transformation and the attributes of <me> are conserved.
|
||||
//! The childs of <me> are conserved.
|
||||
Standard_EXPORT virtual void Clear (const Standard_Boolean WithDestruction = Standard_True);
|
||||
|
||||
//! Suppresses the structure <me>.
|
||||
//! It will be erased at the next screen update.
|
||||
Standard_EXPORT virtual void Destroy();
|
||||
~Graphic3d_Structure()
|
||||
{
|
||||
Destroy();
|
||||
}
|
||||
|
||||
//! Displays the structure <me> in all the views of the visualiser.
|
||||
Standard_EXPORT virtual void Display();
|
||||
|
||||
//! Returns the current display priority for the
|
||||
//! structure <me>.
|
||||
Standard_EXPORT Standard_Integer DisplayPriority() const;
|
||||
|
||||
//! Erases the structure <me> in all the views
|
||||
//! of the visualiser.
|
||||
Standard_EXPORT virtual void Erase();
|
||||
|
||||
//! Highlights the structure <me> in all the views of the visualiser, using the following methods:
|
||||
//! TOHM_COLOR = drawn in the highlight color
|
||||
//! TOHM_BOUNDBOX = enclosed by the boundary box
|
||||
Standard_EXPORT void Highlight (const Aspect_TypeOfHighlightMethod theMethod, const Quantity_Color& theColor, const Standard_Boolean theToUpdateMgr = Standard_True);
|
||||
|
||||
//! Suppress the structure <me>.
|
||||
//! It will be erased at the next screen update.
|
||||
//! Warning: No more graphic operations in <me> after this call.
|
||||
//! Category: Methods to modify the class definition
|
||||
Standard_EXPORT void Remove();
|
||||
|
||||
//! Computes axis-aligned bounding box of a structure.
|
||||
//! Category: Methods to modify the class definition
|
||||
Standard_EXPORT void CalculateBoundBox();
|
||||
|
||||
//! 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.
|
||||
Standard_EXPORT void SetInfiniteState (const Standard_Boolean theToSet);
|
||||
|
||||
//! Modifies the order of displaying the structure.
|
||||
//! Values are between 0 and 10.
|
||||
//! Structures are drawn according to their display priorities
|
||||
//! in ascending order.
|
||||
//! A structure of priority 10 is displayed the last and appears over the others.
|
||||
//! The default value is 5.
|
||||
//! Category: Methods to modify the class definition
|
||||
//! Warning: If <me> is displayed then the SetDisplayPriority
|
||||
//! method erase <me> and display <me> with the
|
||||
//! new priority.
|
||||
//! Raises PriorityDefinitionError if <Priority> is
|
||||
//! greater than 10 or a negative value.
|
||||
Standard_EXPORT void SetDisplayPriority (const Standard_Integer Priority);
|
||||
|
||||
//! Reset the current priority of the structure to the
|
||||
//! previous priority.
|
||||
//! Category: Methods to modify the class definition
|
||||
//! Warning: If <me> is displayed then the SetDisplayPriority
|
||||
//! method erase <me> and display <me> with the
|
||||
//! previous priority.
|
||||
Standard_EXPORT void ResetDisplayPriority();
|
||||
|
||||
//! Set Z layer ID for the structure. The Z layer mechanism
|
||||
//! allows to display structures presented in higher layers in overlay
|
||||
//! of structures in lower layers by switching off z buffer depth
|
||||
//! test between layers
|
||||
Standard_EXPORT void SetZLayer (const Graphic3d_ZLayerId theLayerId);
|
||||
|
||||
//! Get Z layer ID of displayed structure. The method
|
||||
//! returns -1 if the structure has no ID (deleted from graphic driver).
|
||||
Standard_EXPORT Graphic3d_ZLayerId GetZLayer() const;
|
||||
|
||||
//! Changes a sequence of clip planes slicing the structure on rendering.
|
||||
//! @param thePlanes [in] the set of clip planes.
|
||||
Standard_EXPORT void SetClipPlanes (const Graphic3d_SequenceOfHClipPlane& thePlanes);
|
||||
|
||||
//! Get clip planes slicing the structure on rendering.
|
||||
//! @return set of clip planes.
|
||||
Standard_EXPORT const Graphic3d_SequenceOfHClipPlane& GetClipPlanes() const;
|
||||
|
||||
//! Modifies the default attributes for lines
|
||||
//! in the structure <me>.
|
||||
Standard_EXPORT void SetPrimitivesAspect (const Handle(Graphic3d_AspectLine3d)& CTX);
|
||||
|
||||
//! Modifies the default attributes for faces
|
||||
//! in the structure <me>.
|
||||
Standard_EXPORT void SetPrimitivesAspect (const Handle(Graphic3d_AspectFillArea3d)& CTX);
|
||||
|
||||
//! Modifies the default attributes for text
|
||||
//! in the structure <me>.
|
||||
Standard_EXPORT void SetPrimitivesAspect (const Handle(Graphic3d_AspectText3d)& CTX);
|
||||
|
||||
//! Modifies the default attributes for markers
|
||||
//! in the structure <me>.
|
||||
Standard_EXPORT void SetPrimitivesAspect (const Handle(Graphic3d_AspectMarker3d)& CTX);
|
||||
|
||||
//! Modifies the visibility indicator to Standard_True or
|
||||
//! Standard_False for the structure <me>.
|
||||
//! The default value at the definition of <me> is
|
||||
//! Standard_True.
|
||||
Standard_EXPORT void SetVisible (const Standard_Boolean AValue);
|
||||
|
||||
//! Modifies the visualisation mode for the structure <me>.
|
||||
Standard_EXPORT virtual void SetVisual (const Graphic3d_TypeOfStructure AVisual);
|
||||
|
||||
//! Modifies the minimum and maximum zoom coefficients
|
||||
//! for the structure <me>.
|
||||
//! The default value at the definition of <me> is unlimited.
|
||||
//! Category: Methods to modify the class definition
|
||||
//! Warning: Raises StructureDefinitionError if <LimitInf> is
|
||||
//! greater than <LimitSup> or if <LimitInf> or
|
||||
//! <LimitSup> is a negative value.
|
||||
Standard_EXPORT void SetZoomLimit (const Standard_Real LimitInf, const Standard_Real LimitSup);
|
||||
|
||||
//! marks the structure <me> representing wired structure needed for
|
||||
//! highlight only so it won't be added to BVH tree.
|
||||
//! Category: Methods to modify the class definition
|
||||
Standard_EXPORT void SetIsForHighlight (const Standard_Boolean isForHighlight);
|
||||
|
||||
//! Suppresses the highlight for the structure <me>
|
||||
//! in all the views of the visualiser.
|
||||
Standard_EXPORT void UnHighlight();
|
||||
|
||||
Standard_EXPORT virtual void Compute();
|
||||
|
||||
//! Returns the new Structure defined for the new visualization
|
||||
Standard_EXPORT virtual Handle(Graphic3d_Structure) Compute (const Handle(Graphic3d_DataStructureManager)& aProjector);
|
||||
|
||||
//! Returns the new Structure defined for the new visualization
|
||||
Standard_EXPORT virtual Handle(Graphic3d_Structure) Compute (const Handle(Graphic3d_DataStructureManager)& aProjector, const TColStd_Array2OfReal& AMatrix);
|
||||
|
||||
//! Returns the new Structure defined for the new visualization
|
||||
Standard_EXPORT virtual void Compute (const Handle(Graphic3d_DataStructureManager)& aProjector, Handle(Graphic3d_Structure)& aStructure);
|
||||
|
||||
//! Returns the new Structure defined for the new visualization
|
||||
Standard_EXPORT virtual void Compute (const Handle(Graphic3d_DataStructureManager)& aProjector, const TColStd_Array2OfReal& AMatrix, Handle(Graphic3d_Structure)& aStructure);
|
||||
|
||||
//! Forces a new construction of the structure <me>
|
||||
//! if <me> is displayed and TOS_COMPUTED.
|
||||
Standard_EXPORT void ReCompute();
|
||||
|
||||
//! Forces a new construction of the structure <me>
|
||||
//! if <me> is displayed in <aProjetor> and TOS_COMPUTED.
|
||||
Standard_EXPORT void ReCompute (const Handle(Graphic3d_DataStructureManager)& aProjector);
|
||||
|
||||
//! Returns Standard_True if the structure <me> contains
|
||||
//! Polygons, Triangles or Quadrangles.
|
||||
Standard_EXPORT Standard_Boolean ContainsFacet() const;
|
||||
|
||||
//! Returns the values of the current default attributes.
|
||||
Standard_EXPORT Handle(Graphic3d_AspectFillArea3d) FillArea3dAspect() const;
|
||||
|
||||
//! Returns the groups sequence included in the structure <me> (internal storage).
|
||||
Standard_EXPORT const Graphic3d_SequenceOfGroup& Groups() const;
|
||||
|
||||
//! Returns the current number of groups in the
|
||||
//! structure <me>.
|
||||
Standard_EXPORT Standard_Integer NumberOfGroups() const;
|
||||
|
||||
//! Append new group to this structure.
|
||||
Standard_EXPORT Handle(Graphic3d_Group) NewGroup();
|
||||
|
||||
//! Returns the highlight color for the Highlight method
|
||||
//! with the highlight method TOHM_COLOR or TOHM_BOUNDBOX.
|
||||
Standard_EXPORT const Quantity_Color& HighlightColor() const;
|
||||
|
||||
//! Returns Standard_True if the structure <me> is deleted.
|
||||
//! <me> is deleted after the call Remove (me).
|
||||
Standard_EXPORT Standard_Boolean IsDeleted() const;
|
||||
|
||||
//! Returns the display indicator for the structure <me>.
|
||||
Standard_EXPORT virtual Standard_Boolean IsDisplayed() const;
|
||||
|
||||
//! Returns Standard_True if the structure <me> is empty.
|
||||
//! Warning: A structure is empty if :
|
||||
//! it do not have group or all the groups are empties
|
||||
//! and it do not have descendant or all the descendants
|
||||
//! are empties.
|
||||
Standard_EXPORT Standard_Boolean IsEmpty() const;
|
||||
|
||||
//! Returns Standard_True if the structure <me> is infinite.
|
||||
Standard_EXPORT Standard_Boolean IsInfinite() const;
|
||||
|
||||
//! Returns the highlight indicator for the structure <me>.
|
||||
Standard_EXPORT virtual Standard_Boolean IsHighlighted() const;
|
||||
|
||||
//! Returns Standard_True if the structure <me> is rotated.
|
||||
//! <=> The transformation != Identity, != Scale, != Translation.
|
||||
Standard_EXPORT Standard_Boolean IsRotated() const;
|
||||
|
||||
//! Returns Standard_True if the structure <me> is transformed.
|
||||
//! <=> The transformation != Identity.
|
||||
Standard_EXPORT Standard_Boolean IsTransformed() const;
|
||||
|
||||
//! Returns the visibility indicator for the structure <me>.
|
||||
Standard_EXPORT Standard_Boolean IsVisible() const;
|
||||
|
||||
//! Returns the values of the current default attributes.
|
||||
Standard_EXPORT Handle(Graphic3d_AspectLine3d) Line3dAspect() const;
|
||||
|
||||
//! Returns the current group of graphic attributes used
|
||||
//! for 3d marker primitives.
|
||||
Standard_EXPORT Handle(Graphic3d_AspectMarker3d) Marker3dAspect() const;
|
||||
|
||||
//! 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 then the empty box is returned,
|
||||
//! If the structure <me> is infinite then the whole box is returned.
|
||||
Standard_EXPORT Bnd_Box MinMaxValues (const Standard_Boolean theToIgnoreInfiniteFlag = Standard_False) const;
|
||||
|
||||
//! Returns the current values of the default attributes.
|
||||
Standard_EXPORT void PrimitivesAspect (Handle(Graphic3d_AspectLine3d)& CTXL, Handle(Graphic3d_AspectText3d)& CTXT, Handle(Graphic3d_AspectMarker3d)& CTXM, Handle(Graphic3d_AspectFillArea3d)& CTXF) const;
|
||||
|
||||
//! Returns the values of the current default attributes.
|
||||
Standard_EXPORT Handle(Graphic3d_AspectText3d) Text3dAspect() const;
|
||||
|
||||
//! Returns the visualisation mode for the structure <me>.
|
||||
Standard_EXPORT Graphic3d_TypeOfStructure Visual() const;
|
||||
|
||||
//! Returns Standard_True if the connection is possible between
|
||||
//! <AStructure1> and <AStructure2> without a creation
|
||||
//! of a cycle.
|
||||
//!
|
||||
//! It's not possible to call the method
|
||||
//! AStructure1->Connect (AStructure2, TypeOfConnection)
|
||||
//! if
|
||||
//! - the set of all ancestors of <AStructure1> contains
|
||||
//! <AStructure1> and if the
|
||||
//! TypeOfConnection == TOC_DESCENDANT
|
||||
//! - the set of all descendants of <AStructure1> contains
|
||||
//! <AStructure2> and if the
|
||||
//! TypeOfConnection == TOC_ANCESTOR
|
||||
Standard_EXPORT static Standard_Boolean AcceptConnection (const Handle(Graphic3d_Structure)& AStructure1, const Handle(Graphic3d_Structure)& AStructure2, const Graphic3d_TypeOfConnection AType);
|
||||
|
||||
//! Returns the group of structures to which <me> is connected.
|
||||
Standard_EXPORT void Ancestors (Graphic3d_MapOfStructure& SG) const;
|
||||
|
||||
//! If Atype is TOC_DESCENDANT then add <AStructure>
|
||||
//! as a child structure of <me>.
|
||||
//! If Atype is TOC_ANCESTOR then add <AStructure>
|
||||
//! as a parent structure of <me>.
|
||||
//! The connection propagates Display, Highlight, Erase,
|
||||
//! Remove, and stacks the transformations.
|
||||
//! No connection if the graph of the structures
|
||||
//! contains a cycle and <WithCheck> is Standard_True;
|
||||
Standard_EXPORT void Connect (const Handle(Graphic3d_Structure)& AStructure, const Graphic3d_TypeOfConnection AType, const Standard_Boolean WithCheck = Standard_False);
|
||||
|
||||
//! Returns the group of structures connected to <me>.
|
||||
Standard_EXPORT void Descendants (Graphic3d_MapOfStructure& SG) const;
|
||||
|
||||
//! Suppress the connection between <AStructure> and <me>.
|
||||
Standard_EXPORT void Disconnect (const Handle(Graphic3d_Structure)& AStructure);
|
||||
|
||||
//! If Atype is TOC_DESCENDANT then suppress all
|
||||
//! the connections with the child structures of <me>.
|
||||
//! If Atype is TOC_ANCESTOR then suppress all
|
||||
//! the connections with the parent structures of <me>.
|
||||
Standard_EXPORT void DisconnectAll (const Graphic3d_TypeOfConnection AType);
|
||||
|
||||
//! Returns <ASet> the group of structures :
|
||||
//! - directly or indirectly connected to <AStructure> if the
|
||||
//! TypeOfConnection == TOC_DESCENDANT
|
||||
//! - to which <AStructure> is directly or indirectly connected
|
||||
//! if the TypeOfConnection == TOC_ANCESTOR
|
||||
Standard_EXPORT static void Network (const Handle(Graphic3d_Structure)& AStructure, const Graphic3d_TypeOfConnection AType, Graphic3d_MapOfStructure& ASet);
|
||||
|
||||
Standard_EXPORT void SetOwner (const Standard_Address Owner);
|
||||
|
||||
Standard_EXPORT Standard_Address Owner() const;
|
||||
|
||||
Standard_EXPORT void SetHLRValidation (const Standard_Boolean AFlag);
|
||||
|
||||
Standard_EXPORT Standard_Boolean HLRValidation() const;
|
||||
|
||||
//! Returns the type of composition applied to matrices
|
||||
//! of transformation of <me>.
|
||||
Standard_EXPORT Graphic3d_TypeOfComposition Composition() const;
|
||||
|
||||
//! Modifies the current local modelling transformation
|
||||
//! in the structure <me>.
|
||||
//!
|
||||
//! It is defined as a 4*4 real matrix.
|
||||
//!
|
||||
//! -------------------
|
||||
//! | a11 a12 a13 t1 |
|
||||
//! | a21 a22 a23 t2 |
|
||||
//! | a31 a32 a33 t3 |
|
||||
//! | 0 0 0 1 |
|
||||
//! -------------------
|
||||
//!
|
||||
//! TypeOfComposition : TOC_REPLACE
|
||||
//! TOC_POSTCONCATENATE
|
||||
//!
|
||||
//! Then the modified Local Modelling Transformation is composed
|
||||
//! with the current Global Modelling Transformation to create a
|
||||
//! new Composite Modelling Transformation.
|
||||
//!
|
||||
//! The compose type specifies the role of the current local
|
||||
//! modelling transformation (L) in composing the new value for
|
||||
//! the current local modelling transformation (L'), which is
|
||||
//! then combined with the current global modelling transforma-
|
||||
//! tion (G) to calculate the new composite modelling transfor-
|
||||
//! mation (C).
|
||||
//!
|
||||
//! TOC_REPLACE
|
||||
//! The transformation matrix (T) replaces the value of
|
||||
//! current local modelling transformation (L).
|
||||
//!
|
||||
//! L' <- T
|
||||
//! C <- G x L'
|
||||
//!
|
||||
//! TOC_POSTCONCATENATE
|
||||
//! The current local modelling transformation (L) is multiplied
|
||||
//! by the transformation matrix (T):
|
||||
//!
|
||||
//! L' <- T x L
|
||||
//! C <- G x L'
|
||||
//!
|
||||
//! Category: Methods to manage the structure transformation
|
||||
//! Warning: Raises TransformError if the matrix is not a 4x4 matrix.
|
||||
Standard_EXPORT void SetTransform (const TColStd_Array2OfReal& AMatrix, const Graphic3d_TypeOfComposition AType);
|
||||
|
||||
//! Returns the transformation associated with
|
||||
//! the structure <me>.
|
||||
Standard_EXPORT void Transform (TColStd_Array2OfReal& AMatrix) const;
|
||||
|
||||
//! Modifies the current modelling transform persistence (pan, zoom or rotate)
|
||||
Standard_EXPORT void SetTransformPersistence (const Graphic3d_TransModeFlags& AFlag, const gp_Pnt& APoint);
|
||||
|
||||
Standard_EXPORT void SetTransformPersistence (const Graphic3d_TransModeFlags& AFlag);
|
||||
|
||||
//! Get the current modelling transform persistence (pan, zoom or rotate)
|
||||
Standard_EXPORT Graphic3d_TransModeFlags TransformPersistenceMode() const;
|
||||
|
||||
//! Get the current point of relative modelling transform persistence
|
||||
Standard_EXPORT gp_Pnt TransformPersistencePoint() const;
|
||||
|
||||
//! Sets if the structure location has mutable nature (content or location will be changed regularly).
|
||||
Standard_EXPORT void SetMutable (const Standard_Boolean theIsMutable);
|
||||
|
||||
//! Returns true if structure has mutable nature (content or location are be changed regularly).
|
||||
//! Mutable structure will be managed in different way than static onces.
|
||||
Standard_EXPORT Standard_Boolean IsMutable() const;
|
||||
|
||||
Standard_EXPORT Graphic3d_TypeOfStructure ComputeVisual() const;
|
||||
|
||||
//! Clears the structure <me>.
|
||||
Standard_EXPORT void GraphicClear (const Standard_Boolean WithDestruction);
|
||||
|
||||
Standard_EXPORT void GraphicConnect (const Handle(Graphic3d_Structure)& ADaughter);
|
||||
|
||||
Standard_EXPORT void GraphicDisconnect (const Handle(Graphic3d_Structure)& ADaughter);
|
||||
|
||||
//! Highlights the structure <me>.
|
||||
Standard_EXPORT void GraphicHighlight (const Aspect_TypeOfHighlightMethod Method);
|
||||
|
||||
Standard_EXPORT void GraphicTransform (const TColStd_Array2OfReal& AMatrix);
|
||||
|
||||
//! Suppress the highlight for the structure <me>.
|
||||
Standard_EXPORT void GraphicUnHighlight();
|
||||
|
||||
//! Returns the identification number of the structure <me>.
|
||||
Standard_EXPORT Standard_Integer Identification() const;
|
||||
|
||||
//! Prints informations about the network associated
|
||||
//! with the structure <AStructure>.
|
||||
Standard_EXPORT static void PrintNetwork (const Handle(Graphic3d_Structure)& AStructure, const Graphic3d_TypeOfConnection AType);
|
||||
|
||||
//! Suppress the adress <APtr> in the list
|
||||
//! of descendants or in the list of ancestors.
|
||||
Standard_EXPORT void Remove (const Standard_Address APtr, const Graphic3d_TypeOfConnection AType);
|
||||
|
||||
Standard_EXPORT void SetComputeVisual (const Graphic3d_TypeOfStructure AVisual);
|
||||
|
||||
//! Transforms <X>, <Y>, <Z> with the transformation <ATrsf>.
|
||||
Standard_EXPORT static void 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);
|
||||
|
||||
//! Transforms <Coord> with the transformation <ATrsf>.
|
||||
Standard_EXPORT static Graphic3d_Vector Transforms (const TColStd_Array2OfReal& ATrsf, const Graphic3d_Vector& Coord);
|
||||
|
||||
//! Transforms <Coord> with the transformation <ATrsf>.
|
||||
Standard_EXPORT static Graphic3d_Vertex Transforms (const TColStd_Array2OfReal& ATrsf, const Graphic3d_Vertex& Coord);
|
||||
|
||||
//! Returns the low-level structure
|
||||
const Handle(Graphic3d_CStructure)& CStructure() const;
|
||||
|
||||
friend class Graphic3d_Group;
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Graphic3d_Structure,MMgt_TShared)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
//! Transforms boundaries with <theTrsf> transformation.
|
||||
Standard_EXPORT static void TransformBoundaries (const TColStd_Array2OfReal& theTrsf, Standard_Real& theXMin, Standard_Real& theYMin, Standard_Real& theZMin, Standard_Real& theXMax, Standard_Real& theYMax, Standard_Real& theZMax);
|
||||
|
||||
//! Appends new descendant structure.
|
||||
Standard_EXPORT Standard_Boolean AppendDescendant (const Standard_Address theDescendant);
|
||||
|
||||
//! Removes the given descendant structure.
|
||||
Standard_EXPORT Standard_Boolean RemoveDescendant (const Standard_Address theDescendant);
|
||||
|
||||
//! Appends new ancestor structure.
|
||||
Standard_EXPORT Standard_Boolean AppendAncestor (const Standard_Address theAncestor);
|
||||
|
||||
//! Removes the given ancestor structure.
|
||||
Standard_EXPORT Standard_Boolean RemoveAncestor (const Standard_Address theAncestor);
|
||||
|
||||
Graphic3d_StructureManagerPtr myStructureManager;
|
||||
Graphic3d_StructureManagerPtr myFirstStructureManager;
|
||||
Graphic3d_TypeOfStructure myComputeVisual;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
//! Suppress in the structure <me>, the group theGroup.
|
||||
//! It will be erased at the next screen update.
|
||||
Standard_EXPORT void Remove (const Handle(Graphic3d_Group)& theGroup);
|
||||
|
||||
//! Manages the number of groups in the structure <me>
|
||||
//! which contains facet.
|
||||
//! Polygons, Triangles or Quadrangles.
|
||||
//! <ADelta> = +1 or -1
|
||||
Standard_EXPORT void GroupsWithFacet (const Standard_Integer ADelta);
|
||||
|
||||
//! Returns the extreme coordinates found in the structure <me> without transformation applied.
|
||||
Standard_EXPORT Graphic3d_BndBox4f minMaxCoord() const;
|
||||
|
||||
//! Gets untransformed bounding box from structure.
|
||||
Standard_EXPORT void getBox (Graphic3d_BndBox4d& theBox, const Standard_Boolean theToIgnoreInfiniteFlag = Standard_False) const;
|
||||
|
||||
//! Adds transformed (with myCStructure->Transformation) bounding box of structure to theBox.
|
||||
Standard_EXPORT void addTransformed (Graphic3d_BndBox4d& theBox, const Standard_Boolean theToIgnoreInfiniteFlag = Standard_False) const;
|
||||
|
||||
//! Returns the manager to which <me> is associated.
|
||||
Standard_EXPORT Handle(Graphic3d_StructureManager) StructureManager() const;
|
||||
|
||||
//! Calls the Update method of the StructureManager which
|
||||
//! contains the Structure <me>.
|
||||
Standard_EXPORT void Update() const;
|
||||
|
||||
//! Updates the c structure associated to <me>.
|
||||
Standard_EXPORT void UpdateStructure (const Handle(Graphic3d_AspectLine3d)& CTXL, const Handle(Graphic3d_AspectText3d)& CTXT, const Handle(Graphic3d_AspectMarker3d)& CTXM, const Handle(Graphic3d_AspectFillArea3d)& CTXF);
|
||||
|
||||
Handle(Graphic3d_CStructure) myCStructure;
|
||||
Graphic3d_IndexedMapOfAddress myAncestors;
|
||||
Graphic3d_IndexedMapOfAddress myDescendants;
|
||||
Quantity_Color myHighlightColor;
|
||||
Aspect_TypeOfHighlightMethod myHighlightMethod;
|
||||
Standard_Address myOwner;
|
||||
Graphic3d_TypeOfStructure myVisual;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <Graphic3d_Structure.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Graphic3d_Structure_HeaderFile
|
37
src/Graphic3d/Graphic3d_StructureDefinitionError.hxx
Normal file
37
src/Graphic3d/Graphic3d_StructureDefinitionError.hxx
Normal file
@@ -0,0 +1,37 @@
|
||||
// Created on: 1993-03-31
|
||||
// Created by: NW,JPB,CAL
|
||||
// Copyright (c) 1993-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 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 License 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_StructureDefinitionError_HeaderFile
|
||||
#define _Graphic3d_StructureDefinitionError_HeaderFile
|
||||
|
||||
#include <Standard_Type.hxx>
|
||||
#include <Standard_DefineException.hxx>
|
||||
#include <Standard_SStream.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
|
||||
class Graphic3d_StructureDefinitionError;
|
||||
DEFINE_STANDARD_HANDLE(Graphic3d_StructureDefinitionError, Standard_OutOfRange)
|
||||
|
||||
#if !defined No_Exception && !defined No_Graphic3d_StructureDefinitionError
|
||||
#define Graphic3d_StructureDefinitionError_Raise_if(CONDITION, MESSAGE) \
|
||||
if (CONDITION) Graphic3d_StructureDefinitionError::Raise(MESSAGE);
|
||||
#else
|
||||
#define Graphic3d_StructureDefinitionError_Raise_if(CONDITION, MESSAGE)
|
||||
#endif
|
||||
|
||||
DEFINE_STANDARD_EXCEPTION(Graphic3d_StructureDefinitionError, Standard_OutOfRange)
|
||||
|
||||
#endif // _Graphic3d_StructureDefinitionError_HeaderFile
|
@@ -1,508 +0,0 @@
|
||||
-- Created on: 1991-09-05
|
||||
-- Created by: NW,JPB,CAL
|
||||
-- Copyright (c) 1991-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 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 License 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.
|
||||
|
||||
-- 11/97 ; CAL : gestion du GraphicClear
|
||||
-- 05/98 ; CAL : gestion du GraphicConnect et Disconnect
|
||||
|
||||
deferred class StructureManager from Graphic3d inherits TShared
|
||||
|
||||
---Version:
|
||||
|
||||
---Purpose: This class allows the definition of a manager to
|
||||
-- which the graphic objects are associated.
|
||||
-- It allows them to be globally manipulated.
|
||||
-- It defines the global attributes.
|
||||
-- Keywords: Structure, Structure Manager, Update Mode,
|
||||
-- Destroy, Highlight, Visible
|
||||
|
||||
---Warning:
|
||||
---References:
|
||||
|
||||
uses
|
||||
|
||||
Array2OfReal from TColStd,
|
||||
SequenceOfInteger from TColStd,
|
||||
|
||||
GenId from Aspect,
|
||||
TypeOfHighlightMethod from Aspect,
|
||||
TypeOfUpdate from Aspect,
|
||||
|
||||
ZLayerId from Graphic3d,
|
||||
ZLayerSettings from Graphic3d,
|
||||
|
||||
DataStructureManager from Graphic3d,
|
||||
AspectFillArea3d from Graphic3d,
|
||||
AspectLine3d from Graphic3d,
|
||||
AspectMarker3d from Graphic3d,
|
||||
AspectText3d from Graphic3d,
|
||||
Structure from Graphic3d,
|
||||
MapOfStructure from Graphic3d,
|
||||
MapOfObject from Graphic3d,
|
||||
ViewAffinity from Graphic3d,
|
||||
SequenceOfStructure from Graphic3d,
|
||||
GraphicDriver from Graphic3d
|
||||
|
||||
raises
|
||||
|
||||
InitialisationError from Graphic3d
|
||||
|
||||
is
|
||||
|
||||
Initialize ( theDriver: GraphicDriver from Graphic3d )
|
||||
---Level: Public
|
||||
---Purpose: Initialises the ViewManager.
|
||||
-- Currently creating of more than 100 viewer instances
|
||||
-- is not supported and leads to InitializationError and
|
||||
-- initialisation failure.
|
||||
-- This limitation might be addressed in some future OCCT releases.
|
||||
-- Warning: Raises InitialisationError if the initialisation
|
||||
-- of the ViewManager failed.
|
||||
raises InitialisationError from Graphic3d;
|
||||
-- if the initialisation of the ViewManager failed.
|
||||
|
||||
Destroy ( me : mutable )
|
||||
is virtual;
|
||||
---Level: Public
|
||||
---Purpose: Deletes the manager <me>.
|
||||
---C++: alias ~
|
||||
|
||||
---------------------------------------------------
|
||||
-- Category: Methods to modify the class definition
|
||||
---------------------------------------------------
|
||||
|
||||
SetPrimitivesAspect ( me : mutable;
|
||||
CTX : AspectLine3d from Graphic3d )
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Modifies the default attributes for lines
|
||||
-- in the visualiser.
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
SetPrimitivesAspect ( me : mutable;
|
||||
CTX : AspectFillArea3d from Graphic3d)
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Modifies the default attributes for faces
|
||||
-- in the visualiser.
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
SetPrimitivesAspect ( me : mutable;
|
||||
CTX : AspectText3d from Graphic3d )
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Modifies the default attributes for text
|
||||
-- in the visualiser.
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
SetPrimitivesAspect ( me : mutable;
|
||||
CTX : AspectMarker3d from Graphic3d)
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Modifies the default attributes for markers
|
||||
-- in the visualiser.
|
||||
---Category: Methods to modify the class definition
|
||||
|
||||
---------------------------------------------------
|
||||
-- Summary of Dynamic Operations and Update Mode --
|
||||
-- --
|
||||
-- Use SetUpdateMode to control when changes to --
|
||||
-- the display are made. --
|
||||
-- --
|
||||
-- Use one of the following functions to update --
|
||||
-- one or more views : --
|
||||
-- --
|
||||
-- Update all views of the viewer : --
|
||||
-- Visual3d_ViewManager::Update () --
|
||||
-- --
|
||||
-- Update one view of the viewer --
|
||||
-- Visual3d_View::Update () --
|
||||
-- --
|
||||
-- Use one of the following functions to update --
|
||||
-- the entire display : --
|
||||
-- --
|
||||
-- Redraw all structures in all views : --
|
||||
-- Visual3d_ViewManager::Redraw () --
|
||||
-- --
|
||||
-- Redraw all structures in one view : --
|
||||
-- Visual3d_View::Redraw () --
|
||||
---------------------------------------------------
|
||||
|
||||
SetUpdateMode ( me : mutable;
|
||||
AType : TypeOfUpdate from Aspect )
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Modifies the screen update mode.
|
||||
--
|
||||
-- TOU_ASAP as soon as possible
|
||||
-- TOU_WAIT on demand (with the Update function)
|
||||
-- Note : Dynamic Operations and Update Mode
|
||||
-- Use SetUpdateMode to control when changes to
|
||||
-- the display are made. Use one of the following
|
||||
-- functions to update one or more views:
|
||||
-- - Update all views of the viewer: Visual3d_ViewManager::Update ()
|
||||
-- - Update one view of the viewer: Visual3d_View::Update () Use one of
|
||||
-- the following functions to update the entire display:
|
||||
-- - Redraw all structures in all views: Visual3d_ViewManager::Redraw ()
|
||||
-- - Redraw all structures in one view: Visual3d_View::Redraw () Update)
|
||||
|
||||
Update ( me )
|
||||
is deferred;
|
||||
---Purpose: Updates screen in function of modifications of
|
||||
-- the structures.
|
||||
-- Warning: Not necessary if the update mode is TOU_ASAP.
|
||||
|
||||
---------------------------------------------
|
||||
-- Category: Inquire methods, MapOfStructure
|
||||
---------------------------------------------
|
||||
|
||||
DisplayedStructures ( me; SG: in out MapOfStructure from Graphic3d)
|
||||
is static;
|
||||
---Level: Internal
|
||||
---Purpose: Returns the set of structures displayed in
|
||||
-- visualiser <me>.
|
||||
---Category: Inquire methods, MapOfStructure
|
||||
|
||||
NumberOfDisplayedStructures ( me )
|
||||
returns Integer from Standard
|
||||
is static protected;
|
||||
---Level: Internal
|
||||
---Purpose: Returns the number of structures displayed in
|
||||
-- visualiser <me>.
|
||||
|
||||
--DisplayedStructure ( me;
|
||||
-- AnIndex : Integer from Standard )
|
||||
--returns Structure from Graphic3d
|
||||
--is static protected;
|
||||
---Level: Internal
|
||||
---Purpose: Returns the structure displayed in visualiser <me>.
|
||||
|
||||
HighlightedStructures ( me; SG: in out MapOfStructure from Graphic3d )
|
||||
is static;
|
||||
---Level: Internal
|
||||
---Purpose: Returns the set of highlighted structures
|
||||
-- in a visualiser <me>.
|
||||
---Category: Inquire methods, MapOfStructure
|
||||
|
||||
----------------------------
|
||||
-- Category: Inquire methods
|
||||
----------------------------
|
||||
|
||||
FillArea3dAspect ( me )
|
||||
returns AspectFillArea3d from Graphic3d
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns the values of the current default attributes.
|
||||
---Category: Inquire methods
|
||||
|
||||
Limit ( myclass )
|
||||
returns Integer from Standard;
|
||||
---Level: Internal
|
||||
---Purpose: Returns maximum number of managers defineable.
|
||||
---Category: Inquire methods
|
||||
|
||||
Line3dAspect ( me )
|
||||
returns AspectLine3d from Graphic3d
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns the values of the current default attributes.
|
||||
---Category: Inquire methods
|
||||
|
||||
Marker3dAspect ( me )
|
||||
returns AspectMarker3d from Graphic3d
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns the values of the current default attributes.
|
||||
---Category: Inquire methods
|
||||
|
||||
PrimitivesAspect ( me;
|
||||
CTXL : out AspectLine3d from Graphic3d;
|
||||
CTXT : out AspectText3d from Graphic3d;
|
||||
CTXM : out AspectMarker3d from Graphic3d;
|
||||
CTXF : out AspectFillArea3d from Graphic3d )
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns the values of the current default attributes.
|
||||
---Category: Inquire methods
|
||||
|
||||
Text3dAspect ( me )
|
||||
returns AspectText3d from Graphic3d
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns the values of the current default attributes.
|
||||
---Category: Inquire methods
|
||||
|
||||
UpdateMode ( me )
|
||||
returns TypeOfUpdate from Aspect
|
||||
is static;
|
||||
---Level: Public
|
||||
---Purpose: Returns the screen update mode.
|
||||
--
|
||||
-- TOU_ASAP as soon as possible
|
||||
-- TOU_WAIT on demand (Update)
|
||||
--
|
||||
---Category: Inquire methods
|
||||
|
||||
----------------------------
|
||||
-- Category: Private methods
|
||||
----------------------------
|
||||
|
||||
ChangeDisplayPriority ( me : mutable;
|
||||
AStructure : Structure from Graphic3d;
|
||||
OldPriority : Integer from Standard;
|
||||
NewPriority : Integer from Standard )
|
||||
is deferred;
|
||||
---Level: Internal
|
||||
---Purpose: Changes the display priority of the structure <AStructure>.
|
||||
---Category: Private methods
|
||||
|
||||
ChangeZLayer ( me : mutable;
|
||||
theStructure : Structure from Graphic3d;
|
||||
theLayerId : ZLayerId from Graphic3d )
|
||||
is deferred;
|
||||
---Purpose: Change Z layer for structure. The z layer mechanism allows
|
||||
-- to display structures in higher layers in overlay of structures in
|
||||
-- lower layers.
|
||||
|
||||
SetZLayerSettings ( me : mutable;
|
||||
theLayerId : ZLayerId from Graphic3d;
|
||||
theSettings : ZLayerSettings from Graphic3d )
|
||||
is deferred;
|
||||
---Purpose: Sets the settings for a single Z layer for all managed views.
|
||||
|
||||
ZLayerSettings ( me : mutable;
|
||||
theLayerId : ZLayerId from Graphic3d )
|
||||
returns ZLayerSettings from Graphic3d is deferred;
|
||||
---Purpose: Returns the settings of a single Z layer.
|
||||
|
||||
AddZLayer ( me : mutable;
|
||||
theLayerId : out ZLayerId from Graphic3d )
|
||||
returns Boolean from Standard is deferred;
|
||||
---Purpose: Add a new top-level Z layer and get its ID as
|
||||
-- <theLayerId> value. The method returns Standard_False if the layer
|
||||
-- can not be created. The z layer mechanism allows to display
|
||||
-- structures in higher layers in overlay of structures in lower layers.
|
||||
|
||||
RemoveZLayer ( me : mutable;
|
||||
theLayerId : ZLayerId from Graphic3d )
|
||||
returns Boolean from Standard is deferred;
|
||||
---Purpose: Remove Z layer with ID <theLayerId>. Method returns
|
||||
-- Standard_False if the layer can not be removed or doesn't exists.
|
||||
-- By default, there is always a default bottom-level layer that can't
|
||||
-- be removed.
|
||||
|
||||
GetAllZLayers ( me;
|
||||
theLayerSeq : out SequenceOfInteger from TColStd )
|
||||
is deferred;
|
||||
---Purpose: Return all Z layer ids in sequence ordered by level
|
||||
-- from lowest layer to highest. The first layer ID in sequence is
|
||||
-- the default layer that can't be removed.
|
||||
|
||||
CurrentId ( myclass )
|
||||
returns Integer from Standard;
|
||||
---Level: Internal
|
||||
---Purpose: Returns a current identifier available.
|
||||
---Category: Private methods
|
||||
|
||||
ReCompute ( me : mutable;
|
||||
AStructure : Structure from Graphic3d )
|
||||
is deferred;
|
||||
---Level: Advanced
|
||||
---Purpose: Forces a new construction of the structure <AStructure>
|
||||
-- if <AStructure> is displayed and TOS_COMPUTED.
|
||||
---Category: Private methods
|
||||
|
||||
ReCompute ( me : mutable;
|
||||
AStructure : Structure from Graphic3d;
|
||||
AProjector : DataStructureManager from Graphic3d )
|
||||
is deferred;
|
||||
---Level: Advanced
|
||||
---Purpose: Forces a new construction of the structure <AStructure>
|
||||
-- if <AStructure> is displayed in <AProjector> and TOS_COMPUTED.
|
||||
---Category: Private methods
|
||||
|
||||
Clear ( me : mutable;
|
||||
AStructure : Structure from Graphic3d;
|
||||
WithDestruction : Boolean from Standard )
|
||||
is deferred;
|
||||
---Level: Internal
|
||||
---Purpose: Clears the structure <AStructure>.
|
||||
---Category: Private methods
|
||||
|
||||
Connect ( me : mutable;
|
||||
AMother : Structure from Graphic3d;
|
||||
ADaughter : Structure from Graphic3d )
|
||||
is deferred;
|
||||
---Level: Internal
|
||||
---Purpose: Connects the structures <AMother> and <ADaughter>.
|
||||
---Category: Private methods
|
||||
|
||||
Disconnect ( me : mutable;
|
||||
AMother : Structure from Graphic3d;
|
||||
ADaughter : Structure from Graphic3d )
|
||||
is deferred;
|
||||
---Level: Internal
|
||||
---Purpose: Disconnects the structures <AMother> and <ADaughter>.
|
||||
---Category: Private methods
|
||||
|
||||
Display ( me : mutable;
|
||||
AStructure : Structure from Graphic3d )
|
||||
is deferred;
|
||||
---Level: Internal
|
||||
---Purpose: Display the structure <AStructure>.
|
||||
---Category: Private methods
|
||||
|
||||
Erase ( me : mutable;
|
||||
AStructure : Structure from Graphic3d )
|
||||
is deferred;
|
||||
---Level: Internal
|
||||
---Purpose: Erases the structure <AStructure>.
|
||||
---Category: Private methods
|
||||
|
||||
Highlight ( me : mutable;
|
||||
AStructure : Structure from Graphic3d;
|
||||
AMethod : TypeOfHighlightMethod from Aspect )
|
||||
is deferred;
|
||||
---Level: Internal
|
||||
---Purpose: Highlights the structure <AStructure>.
|
||||
---Category: Private methods
|
||||
|
||||
SetTransform ( me : mutable;
|
||||
AStructure : Structure from Graphic3d;
|
||||
ATrsf : Array2OfReal from TColStd )
|
||||
is deferred;
|
||||
---Level: Internal
|
||||
---Purpose: Transforms the structure <AStructure>.
|
||||
---Category: Private methods
|
||||
|
||||
GraphicDriver ( me )
|
||||
returns GraphicDriver from Graphic3d;
|
||||
---Level: Internal
|
||||
---Purpose: Returns the graphic driver of <me>.
|
||||
---Category: Private methods
|
||||
---C++: return const &
|
||||
|
||||
Identification ( me )
|
||||
returns Integer from Standard
|
||||
is virtual;
|
||||
---Level: Internal
|
||||
---Purpose: Returns the identification number of the manager.
|
||||
---Category: Private methods
|
||||
|
||||
Identification ( me;
|
||||
AId : Integer from Standard )
|
||||
returns Structure from Graphic3d
|
||||
is virtual;
|
||||
---Level: Internal
|
||||
---Purpose: Returns the structure with the identification number <AId>.
|
||||
---Warning: Returns a null structure if the identification number
|
||||
-- is not a structure identifier.
|
||||
---Category: Private methods
|
||||
|
||||
NewIdentification ( me : mutable )
|
||||
returns Integer from Standard
|
||||
is static;
|
||||
---Level: Internal
|
||||
---Purpose: Returns a new identification number for a new structure in the manager.
|
||||
|
||||
Remove ( me : mutable;
|
||||
AnId : Integer from Standard )
|
||||
is static private;
|
||||
---Level: Internal
|
||||
---Purpose: Frees the identifieur <AnId>.
|
||||
---Category: Private methods
|
||||
|
||||
UnHighlight ( me : mutable )
|
||||
is deferred;
|
||||
---Level: Internal
|
||||
---Purpose: Suppresses the highlighting on all the structures in <me>.
|
||||
---Category: Private methods
|
||||
|
||||
UnHighlight ( me : mutable;
|
||||
AStructure : Structure from Graphic3d )
|
||||
is deferred;
|
||||
---Level: Internal
|
||||
---Purpose: Suppress the highlighting on the structure <AStructure>.
|
||||
---Category: Private methods
|
||||
|
||||
RecomputeStructures (me: mutable);
|
||||
-- Purpose: Recomputes all displayed structures. Used to recompute GL
|
||||
-- resources after the last view has been closed without removing objects.
|
||||
|
||||
RecomputeStructures (me: mutable;
|
||||
theStructures : MapOfStructure from Graphic3d);
|
||||
---Purpose: Recomputes all structures from theStructures.
|
||||
|
||||
RegisterObject (me : mutable;
|
||||
theObject : Transient from Standard)
|
||||
returns ViewAffinity from Graphic3d
|
||||
is static;
|
||||
|
||||
UnregisterObject (me : mutable;
|
||||
theObject : Transient from Standard) is static;
|
||||
|
||||
ObjectAffinity (me;
|
||||
theObject : Transient from Standard)
|
||||
returns ViewAffinity from Graphic3d
|
||||
is static;
|
||||
|
||||
--
|
||||
|
||||
fields
|
||||
|
||||
--
|
||||
-- Class : Graphic3d_StructureManager
|
||||
--
|
||||
-- Purpose : Declaration of variables specific to managers
|
||||
--
|
||||
-- Reminder : A manager manipulates a group of structures
|
||||
|
||||
-- the identifier of the manager
|
||||
MyId : Integer from Standard is protected;
|
||||
|
||||
-- the update display mode
|
||||
MyUpdateMode : TypeOfUpdate from Aspect is protected;
|
||||
|
||||
-- the different contexts for primitives
|
||||
MyAspectLine3d : AspectLine3d from Graphic3d
|
||||
is protected;
|
||||
MyAspectText3d : AspectText3d from Graphic3d
|
||||
is protected;
|
||||
MyAspectMarker3d : AspectMarker3d from Graphic3d
|
||||
is protected;
|
||||
MyAspectFillArea3d : AspectFillArea3d from Graphic3d
|
||||
is protected;
|
||||
|
||||
-- the displayed structures
|
||||
MyDisplayedStructure : MapOfStructure from Graphic3d
|
||||
is protected;
|
||||
|
||||
myRegisteredObjects : MapOfObject from Graphic3d is protected;
|
||||
|
||||
-- the highlighted structures
|
||||
MyHighlightedStructure : MapOfStructure from Graphic3d
|
||||
is protected;
|
||||
|
||||
-- the structure identifier generator
|
||||
MyStructGenId : GenId from Aspect is protected;
|
||||
|
||||
|
||||
MyGraphicDriver : GraphicDriver from Graphic3d is protected;
|
||||
|
||||
friends
|
||||
|
||||
class Structure from Graphic3d
|
||||
|
||||
end StructureManager;
|
@@ -14,20 +14,26 @@
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
//-Version
|
||||
|
||||
//-Design Declaration of variables specific to managers
|
||||
|
||||
//-Warning Manager manages a set of structures
|
||||
|
||||
//-References
|
||||
|
||||
//-Language C++ 2.0
|
||||
|
||||
//-Declarations
|
||||
|
||||
// for the class
|
||||
#include <Graphic3d_StructureManager.ixx>
|
||||
|
||||
#include <Graphic3d_AspectFillArea3d.hxx>
|
||||
#include <Graphic3d_AspectLine3d.hxx>
|
||||
#include <Graphic3d_AspectMarker3d.hxx>
|
||||
#include <Graphic3d_AspectText3d.hxx>
|
||||
#include <Graphic3d_DataStructureManager.hxx>
|
||||
#include <Graphic3d_GraphicDriver.hxx>
|
||||
#include <Graphic3d_InitialisationError.hxx>
|
||||
#include <Graphic3d_Structure.hxx>
|
||||
#include <Graphic3d_StructureManager.hxx>
|
||||
#include <Graphic3d_StructureManager.pxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
static Standard_Boolean Initialisation = Standard_True;
|
||||
static int StructureManager_ArrayId[StructureManager_MAX];
|
||||
static Standard_Integer StructureManager_CurrentId = 0;
|
||||
|
280
src/Graphic3d/Graphic3d_StructureManager.hxx
Normal file
280
src/Graphic3d/Graphic3d_StructureManager.hxx
Normal file
@@ -0,0 +1,280 @@
|
||||
// Created on: 1991-09-05
|
||||
// Created by: NW,JPB,CAL
|
||||
// Copyright (c) 1991-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 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 License 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_StructureManager_HeaderFile
|
||||
#define _Graphic3d_StructureManager_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <Aspect_TypeOfUpdate.hxx>
|
||||
#include <Graphic3d_MapOfStructure.hxx>
|
||||
#include <Graphic3d_MapOfObject.hxx>
|
||||
#include <Aspect_GenId.hxx>
|
||||
#include <MMgt_TShared.hxx>
|
||||
#include <Graphic3d_ZLayerId.hxx>
|
||||
#include <Graphic3d_ZLayerSettings.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <TColStd_SequenceOfInteger.hxx>
|
||||
#include <Aspect_TypeOfHighlightMethod.hxx>
|
||||
#include <TColStd_Array2OfReal.hxx>
|
||||
#include <Graphic3d_ViewAffinity.hxx>
|
||||
class Graphic3d_AspectLine3d;
|
||||
class Graphic3d_AspectText3d;
|
||||
class Graphic3d_AspectMarker3d;
|
||||
class Graphic3d_AspectFillArea3d;
|
||||
class Graphic3d_GraphicDriver;
|
||||
class Graphic3d_InitialisationError;
|
||||
class Graphic3d_Structure;
|
||||
class Graphic3d_DataStructureManager;
|
||||
class Standard_Transient;
|
||||
|
||||
|
||||
class Graphic3d_StructureManager;
|
||||
DEFINE_STANDARD_HANDLE(Graphic3d_StructureManager, MMgt_TShared)
|
||||
|
||||
//! This class allows the definition of a manager to
|
||||
//! which the graphic objects are associated.
|
||||
//! It allows them to be globally manipulated.
|
||||
//! It defines the global attributes.
|
||||
//! Keywords: Structure, Structure Manager, Update Mode,
|
||||
//! Destroy, Highlight, Visible
|
||||
class Graphic3d_StructureManager : public MMgt_TShared
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Deletes the manager <me>.
|
||||
Standard_EXPORT virtual void Destroy();
|
||||
~Graphic3d_StructureManager()
|
||||
{
|
||||
Destroy();
|
||||
}
|
||||
|
||||
//! Modifies the default attributes for lines
|
||||
//! in the visualiser.
|
||||
Standard_EXPORT void SetPrimitivesAspect (const Handle(Graphic3d_AspectLine3d)& CTX);
|
||||
|
||||
//! Modifies the default attributes for faces
|
||||
//! in the visualiser.
|
||||
Standard_EXPORT void SetPrimitivesAspect (const Handle(Graphic3d_AspectFillArea3d)& CTX);
|
||||
|
||||
//! Modifies the default attributes for text
|
||||
//! in the visualiser.
|
||||
Standard_EXPORT void SetPrimitivesAspect (const Handle(Graphic3d_AspectText3d)& CTX);
|
||||
|
||||
//! Modifies the default attributes for markers
|
||||
//! in the visualiser.
|
||||
Standard_EXPORT void SetPrimitivesAspect (const Handle(Graphic3d_AspectMarker3d)& CTX);
|
||||
|
||||
//! Modifies the screen update mode.
|
||||
//!
|
||||
//! TOU_ASAP as soon as possible
|
||||
//! TOU_WAIT on demand (with the Update function)
|
||||
//! Note : Dynamic Operations and Update Mode
|
||||
//! Use SetUpdateMode to control when changes to
|
||||
//! the display are made. Use one of the following
|
||||
//! functions to update one or more views:
|
||||
//! - Update all views of the viewer: Visual3d_ViewManager::Update ()
|
||||
//! - Update one view of the viewer: Visual3d_View::Update () Use one of
|
||||
//! the following functions to update the entire display:
|
||||
//! - Redraw all structures in all views: Visual3d_ViewManager::Redraw ()
|
||||
//! - Redraw all structures in one view: Visual3d_View::Redraw () Update)
|
||||
Standard_EXPORT void SetUpdateMode (const Aspect_TypeOfUpdate AType);
|
||||
|
||||
//! Updates screen in function of modifications of
|
||||
//! the structures.
|
||||
//! Warning: Not necessary if the update mode is TOU_ASAP.
|
||||
Standard_EXPORT virtual void Update() const = 0;
|
||||
|
||||
//! Returns the set of structures displayed in
|
||||
//! visualiser <me>.
|
||||
Standard_EXPORT void DisplayedStructures (Graphic3d_MapOfStructure& SG) const;
|
||||
|
||||
//! Returns the set of highlighted structures
|
||||
//! in a visualiser <me>.
|
||||
Standard_EXPORT void HighlightedStructures (Graphic3d_MapOfStructure& SG) const;
|
||||
|
||||
//! Returns the values of the current default attributes.
|
||||
Standard_EXPORT Handle(Graphic3d_AspectFillArea3d) FillArea3dAspect() const;
|
||||
|
||||
//! Returns maximum number of managers defineable.
|
||||
Standard_EXPORT static Standard_Integer Limit();
|
||||
|
||||
//! Returns the values of the current default attributes.
|
||||
Standard_EXPORT Handle(Graphic3d_AspectLine3d) Line3dAspect() const;
|
||||
|
||||
//! Returns the values of the current default attributes.
|
||||
Standard_EXPORT Handle(Graphic3d_AspectMarker3d) Marker3dAspect() const;
|
||||
|
||||
//! Returns the values of the current default attributes.
|
||||
Standard_EXPORT void PrimitivesAspect (Handle(Graphic3d_AspectLine3d)& CTXL, Handle(Graphic3d_AspectText3d)& CTXT, Handle(Graphic3d_AspectMarker3d)& CTXM, Handle(Graphic3d_AspectFillArea3d)& CTXF) const;
|
||||
|
||||
//! Returns the values of the current default attributes.
|
||||
Standard_EXPORT Handle(Graphic3d_AspectText3d) Text3dAspect() const;
|
||||
|
||||
//! Returns the screen update mode.
|
||||
//!
|
||||
//! TOU_ASAP as soon as possible
|
||||
//! TOU_WAIT on demand (Update)
|
||||
Standard_EXPORT Aspect_TypeOfUpdate UpdateMode() const;
|
||||
|
||||
//! Changes the display priority of the structure <AStructure>.
|
||||
Standard_EXPORT virtual void ChangeDisplayPriority (const Handle(Graphic3d_Structure)& AStructure, const Standard_Integer OldPriority, const Standard_Integer NewPriority) = 0;
|
||||
|
||||
//! Change Z layer for structure. The z layer mechanism allows
|
||||
//! to display structures in higher layers in overlay of structures in
|
||||
//! lower layers.
|
||||
Standard_EXPORT virtual void ChangeZLayer (const Handle(Graphic3d_Structure)& theStructure, const Graphic3d_ZLayerId theLayerId) = 0;
|
||||
|
||||
//! Sets the settings for a single Z layer for all managed views.
|
||||
Standard_EXPORT virtual void SetZLayerSettings (const Graphic3d_ZLayerId theLayerId, const Graphic3d_ZLayerSettings& theSettings) = 0;
|
||||
|
||||
//! Returns the settings of a single Z layer.
|
||||
Standard_EXPORT virtual Graphic3d_ZLayerSettings ZLayerSettings (const Graphic3d_ZLayerId theLayerId) = 0;
|
||||
|
||||
//! Add a new top-level Z layer and get its ID as
|
||||
//! <theLayerId> value. The method returns Standard_False if the layer
|
||||
//! can not be created. The z layer mechanism allows to display
|
||||
//! structures in higher layers in overlay of structures in lower layers.
|
||||
Standard_EXPORT virtual Standard_Boolean AddZLayer (Graphic3d_ZLayerId& theLayerId) = 0;
|
||||
|
||||
//! Remove Z layer with ID <theLayerId>. Method returns
|
||||
//! Standard_False if the layer can not be removed or doesn't exists.
|
||||
//! By default, there is always a default bottom-level layer that can't
|
||||
//! be removed.
|
||||
Standard_EXPORT virtual Standard_Boolean RemoveZLayer (const Graphic3d_ZLayerId theLayerId) = 0;
|
||||
|
||||
//! Return all Z layer ids in sequence ordered by level
|
||||
//! from lowest layer to highest. The first layer ID in sequence is
|
||||
//! the default layer that can't be removed.
|
||||
Standard_EXPORT virtual void GetAllZLayers (TColStd_SequenceOfInteger& theLayerSeq) const = 0;
|
||||
|
||||
//! Returns a current identifier available.
|
||||
Standard_EXPORT static Standard_Integer CurrentId();
|
||||
|
||||
//! Forces a new construction of the structure <AStructure>
|
||||
//! if <AStructure> is displayed and TOS_COMPUTED.
|
||||
Standard_EXPORT virtual void ReCompute (const Handle(Graphic3d_Structure)& AStructure) = 0;
|
||||
|
||||
//! Forces a new construction of the structure <AStructure>
|
||||
//! if <AStructure> is displayed in <AProjector> and TOS_COMPUTED.
|
||||
Standard_EXPORT virtual void ReCompute (const Handle(Graphic3d_Structure)& AStructure, const Handle(Graphic3d_DataStructureManager)& AProjector) = 0;
|
||||
|
||||
//! Clears the structure <AStructure>.
|
||||
Standard_EXPORT virtual void Clear (const Handle(Graphic3d_Structure)& AStructure, const Standard_Boolean WithDestruction) = 0;
|
||||
|
||||
//! Connects the structures <AMother> and <ADaughter>.
|
||||
Standard_EXPORT virtual void Connect (const Handle(Graphic3d_Structure)& AMother, const Handle(Graphic3d_Structure)& ADaughter) = 0;
|
||||
|
||||
//! Disconnects the structures <AMother> and <ADaughter>.
|
||||
Standard_EXPORT virtual void Disconnect (const Handle(Graphic3d_Structure)& AMother, const Handle(Graphic3d_Structure)& ADaughter) = 0;
|
||||
|
||||
//! Display the structure <AStructure>.
|
||||
Standard_EXPORT virtual void Display (const Handle(Graphic3d_Structure)& AStructure) = 0;
|
||||
|
||||
//! Erases the structure <AStructure>.
|
||||
Standard_EXPORT virtual void Erase (const Handle(Graphic3d_Structure)& AStructure) = 0;
|
||||
|
||||
//! Highlights the structure <AStructure>.
|
||||
Standard_EXPORT virtual void Highlight (const Handle(Graphic3d_Structure)& AStructure, const Aspect_TypeOfHighlightMethod AMethod) = 0;
|
||||
|
||||
//! Transforms the structure <AStructure>.
|
||||
Standard_EXPORT virtual void SetTransform (const Handle(Graphic3d_Structure)& AStructure, const TColStd_Array2OfReal& ATrsf) = 0;
|
||||
|
||||
//! Returns the graphic driver of <me>.
|
||||
Standard_EXPORT const Handle(Graphic3d_GraphicDriver)& GraphicDriver() const;
|
||||
|
||||
//! Returns the identification number of the manager.
|
||||
Standard_EXPORT virtual Standard_Integer Identification() const;
|
||||
|
||||
//! Returns the structure with the identification number <AId>.
|
||||
Standard_EXPORT virtual Handle(Graphic3d_Structure) Identification (const Standard_Integer AId) const;
|
||||
|
||||
//! Returns a new identification number for a new structure in the manager.
|
||||
Standard_EXPORT Standard_Integer NewIdentification();
|
||||
|
||||
//! Suppresses the highlighting on all the structures in <me>.
|
||||
Standard_EXPORT virtual void UnHighlight() = 0;
|
||||
|
||||
//! Suppress the highlighting on the structure <AStructure>.
|
||||
Standard_EXPORT virtual void UnHighlight (const Handle(Graphic3d_Structure)& AStructure) = 0;
|
||||
|
||||
Standard_EXPORT void RecomputeStructures();
|
||||
|
||||
//! Recomputes all structures from theStructures.
|
||||
Standard_EXPORT void RecomputeStructures (const Graphic3d_MapOfStructure& theStructures);
|
||||
|
||||
Standard_EXPORT Handle(Graphic3d_ViewAffinity) RegisterObject (const Handle(Standard_Transient)& theObject);
|
||||
|
||||
Standard_EXPORT void UnregisterObject (const Handle(Standard_Transient)& theObject);
|
||||
|
||||
Standard_EXPORT Handle(Graphic3d_ViewAffinity) ObjectAffinity (const Handle(Standard_Transient)& theObject) const;
|
||||
|
||||
friend class Graphic3d_Structure;
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Graphic3d_StructureManager,MMgt_TShared)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
//! Initialises the ViewManager.
|
||||
//! Currently creating of more than 100 viewer instances
|
||||
//! is not supported and leads to InitializationError and
|
||||
//! initialisation failure.
|
||||
//! This limitation might be addressed in some future OCCT releases.
|
||||
//! Warning: Raises InitialisationError if the initialisation
|
||||
//! of the ViewManager failed.
|
||||
Standard_EXPORT Graphic3d_StructureManager(const Handle(Graphic3d_GraphicDriver)& theDriver);
|
||||
|
||||
//! Returns the number of structures displayed in
|
||||
//! visualiser <me>.
|
||||
//! Returns the structure displayed in visualiser <me>.
|
||||
Standard_EXPORT Standard_Integer NumberOfDisplayedStructures() const;
|
||||
|
||||
Standard_Integer MyId;
|
||||
Aspect_TypeOfUpdate MyUpdateMode;
|
||||
Handle(Graphic3d_AspectLine3d) MyAspectLine3d;
|
||||
Handle(Graphic3d_AspectText3d) MyAspectText3d;
|
||||
Handle(Graphic3d_AspectMarker3d) MyAspectMarker3d;
|
||||
Handle(Graphic3d_AspectFillArea3d) MyAspectFillArea3d;
|
||||
Graphic3d_MapOfStructure MyDisplayedStructure;
|
||||
Graphic3d_MapOfObject myRegisteredObjects;
|
||||
Graphic3d_MapOfStructure MyHighlightedStructure;
|
||||
Aspect_GenId MyStructGenId;
|
||||
Handle(Graphic3d_GraphicDriver) MyGraphicDriver;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
//! Frees the identifieur <AnId>.
|
||||
Standard_EXPORT void Remove (const Standard_Integer AnId);
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Graphic3d_StructureManager_HeaderFile
|
23
src/Graphic3d/Graphic3d_StructureManagerPtr.hxx
Normal file
23
src/Graphic3d/Graphic3d_StructureManagerPtr.hxx
Normal file
@@ -0,0 +1,23 @@
|
||||
// Created on: 1993-03-31
|
||||
// Created by: NW,JPB,CAL
|
||||
// Copyright (c) 1993-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 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 License 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_StructureManagerPtr_HeaderFile
|
||||
#define _Graphic3d_StructureManagerPtr_HeaderFile
|
||||
|
||||
class Graphic3d_StructureManager;
|
||||
typedef Graphic3d_StructureManager* Graphic3d_StructureManagerPtr;
|
||||
|
||||
#endif // _Graphic3d_StructureManagerPtr_HeaderFile
|
23
src/Graphic3d/Graphic3d_StructurePtr.hxx
Normal file
23
src/Graphic3d/Graphic3d_StructurePtr.hxx
Normal file
@@ -0,0 +1,23 @@
|
||||
// Created on: 1993-03-31
|
||||
// Created by: NW,JPB,CAL
|
||||
// Copyright (c) 1993-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 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 License 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_StructurePtr_HeaderFile
|
||||
#define _Graphic3d_StructurePtr_HeaderFile
|
||||
|
||||
class Graphic3d_Structure;
|
||||
typedef Graphic3d_Structure* Graphic3d_StructurePtr;
|
||||
|
||||
#endif // _Graphic3d_StructurePtr_HeaderFile
|
29
src/Graphic3d/Graphic3d_TextPath.hxx
Normal file
29
src/Graphic3d/Graphic3d_TextPath.hxx
Normal file
@@ -0,0 +1,29 @@
|
||||
// Created on: 1993-03-31
|
||||
// Created by: NW,JPB,CAL
|
||||
// Copyright (c) 1993-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 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 License 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_TextPath_HeaderFile
|
||||
#define _Graphic3d_TextPath_HeaderFile
|
||||
|
||||
//! Direction in which text is displayed.
|
||||
enum Graphic3d_TextPath
|
||||
{
|
||||
Graphic3d_TP_UP,
|
||||
Graphic3d_TP_DOWN,
|
||||
Graphic3d_TP_LEFT,
|
||||
Graphic3d_TP_RIGHT
|
||||
};
|
||||
|
||||
#endif // _Graphic3d_TextPath_HeaderFile
|
@@ -1,68 +0,0 @@
|
||||
-- Created on: 1997-07-28
|
||||
-- Created by: Pierre CHALAMET
|
||||
-- Copyright (c) 1997-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 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 License 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.
|
||||
|
||||
deferred class Texture1D from Graphic3d
|
||||
|
||||
inherits TextureMap from Graphic3d
|
||||
|
||||
---Purpose: This is an abstract class for managing 1D textures.
|
||||
|
||||
uses
|
||||
|
||||
TypeOfTexture from Graphic3d,
|
||||
NameOfTexture1D from Graphic3d,
|
||||
AsciiString from TCollection,
|
||||
PixMap_Handle from Image
|
||||
|
||||
raises
|
||||
|
||||
OutOfRange from Standard
|
||||
|
||||
is
|
||||
|
||||
Initialize (theFileName : AsciiString from TCollection;
|
||||
theType : TypeOfTexture from Graphic3d);
|
||||
|
||||
Initialize (theName : NameOfTexture1D from Graphic3d;
|
||||
theType : TypeOfTexture from Graphic3d);
|
||||
|
||||
Initialize (thePixMap : PixMap_Handle from Image;
|
||||
theType : TypeOfTexture from Graphic3d);
|
||||
|
||||
Name (me) returns NameOfTexture1D from Graphic3d;
|
||||
---Purpose:
|
||||
-- Returns the name of the predefined textures or NOT_1D_UNKNOWN
|
||||
-- when the name is given as a filename.
|
||||
---Level: Public
|
||||
|
||||
NumberOfTextures (myclass) returns Integer from Standard;
|
||||
---Purpose:
|
||||
-- Returns the number of predefined textures.
|
||||
---Level: Public
|
||||
|
||||
TextureName (myclass; aRank: Integer from Standard)
|
||||
returns AsciiString from TCollection
|
||||
raises OutOfRange from Standard;
|
||||
---Purpose:
|
||||
-- Returns the name of the predefined texture of rank <aRank>
|
||||
---Trigger: when <aRank> is < 1 or > NumberOfTextures.
|
||||
---Level: Public
|
||||
|
||||
fields
|
||||
|
||||
myName : NameOfTexture1D from Graphic3d;
|
||||
|
||||
end Texture1D;
|
@@ -14,7 +14,10 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Graphic3d_Texture1D.ixx>
|
||||
|
||||
#include <Graphic3d_Texture1D.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
static const char *NameOfTexture_to_FileName[] =
|
||||
|
85
src/Graphic3d/Graphic3d_Texture1D.hxx
Normal file
85
src/Graphic3d/Graphic3d_Texture1D.hxx
Normal file
@@ -0,0 +1,85 @@
|
||||
// Created on: 1997-07-28
|
||||
// Created by: Pierre CHALAMET
|
||||
// Copyright (c) 1997-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 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 License 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_Texture1D_HeaderFile
|
||||
#define _Graphic3d_Texture1D_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Graphic3d_NameOfTexture1D.hxx>
|
||||
#include <Graphic3d_TextureMap.hxx>
|
||||
#include <Graphic3d_TypeOfTexture.hxx>
|
||||
#include <Image_PixMap_Handle.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
class Standard_OutOfRange;
|
||||
class TCollection_AsciiString;
|
||||
|
||||
|
||||
class Graphic3d_Texture1D;
|
||||
DEFINE_STANDARD_HANDLE(Graphic3d_Texture1D, Graphic3d_TextureMap)
|
||||
|
||||
//! This is an abstract class for managing 1D textures.
|
||||
class Graphic3d_Texture1D : public Graphic3d_TextureMap
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
|
||||
//! Returns the name of the predefined textures or NOT_1D_UNKNOWN
|
||||
//! when the name is given as a filename.
|
||||
Standard_EXPORT Graphic3d_NameOfTexture1D Name() const;
|
||||
|
||||
|
||||
//! Returns the number of predefined textures.
|
||||
Standard_EXPORT static Standard_Integer NumberOfTextures();
|
||||
|
||||
|
||||
//! Returns the name of the predefined texture of rank <aRank>
|
||||
Standard_EXPORT static TCollection_AsciiString TextureName (const Standard_Integer aRank);
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Graphic3d_Texture1D,Graphic3d_TextureMap)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
Standard_EXPORT Graphic3d_Texture1D(const TCollection_AsciiString& theFileName, const Graphic3d_TypeOfTexture theType);
|
||||
|
||||
Standard_EXPORT Graphic3d_Texture1D(const Graphic3d_NameOfTexture1D theName, const Graphic3d_TypeOfTexture theType);
|
||||
|
||||
Standard_EXPORT Graphic3d_Texture1D(const Image_PixMap_Handle& thePixMap, const Graphic3d_TypeOfTexture theType);
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Graphic3d_NameOfTexture1D myName;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Graphic3d_Texture1D_HeaderFile
|
@@ -1,41 +0,0 @@
|
||||
-- Created on: 1997-07-28
|
||||
-- Created by: Pierre CHALAMET
|
||||
-- Copyright (c) 1997-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 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 License 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.
|
||||
|
||||
class Texture1Dmanual from Graphic3d
|
||||
|
||||
inherits Texture1D from Graphic3d
|
||||
|
||||
---Purpose: This class provides the implementation of a manual 1D texture.
|
||||
-- you MUST provides texture coordinates on your facets if you want to see your texture.
|
||||
|
||||
uses
|
||||
|
||||
NameOfTexture1D from Graphic3d,
|
||||
AsciiString from TCollection,
|
||||
PixMap_Handle from Image
|
||||
|
||||
is
|
||||
|
||||
Create (theFileName : AsciiString from TCollection) returns Texture1Dmanual from Graphic3d;
|
||||
---Purpose: Creates a texture from the file FileName.
|
||||
|
||||
Create (theNOT : NameOfTexture1D from Graphic3d) returns Texture1Dmanual from Graphic3d;
|
||||
---Purpose: Create a texture from a predefined texture name set.
|
||||
|
||||
Create (thePixMap : PixMap_Handle from Image) returns Texture1Dmanual from Graphic3d;
|
||||
---Purpose: Creates a texture from the pixmap.
|
||||
|
||||
end Texture1Dmanual;
|
@@ -14,8 +14,11 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Graphic3d_Texture1Dmanual.ixx>
|
||||
|
||||
#include <Graphic3d_Texture1Dmanual.hxx>
|
||||
#include <Graphic3d_TypeOfTextureMode.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
// =======================================================================
|
||||
// function : Graphic3d_Texture1Dmanual
|
||||
|
72
src/Graphic3d/Graphic3d_Texture1Dmanual.hxx
Normal file
72
src/Graphic3d/Graphic3d_Texture1Dmanual.hxx
Normal file
@@ -0,0 +1,72 @@
|
||||
// Created on: 1997-07-28
|
||||
// Created by: Pierre CHALAMET
|
||||
// Copyright (c) 1997-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 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 License 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_Texture1Dmanual_HeaderFile
|
||||
#define _Graphic3d_Texture1Dmanual_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Graphic3d_Texture1D.hxx>
|
||||
#include <Graphic3d_NameOfTexture1D.hxx>
|
||||
#include <Image_PixMap_Handle.hxx>
|
||||
class TCollection_AsciiString;
|
||||
|
||||
|
||||
class Graphic3d_Texture1Dmanual;
|
||||
DEFINE_STANDARD_HANDLE(Graphic3d_Texture1Dmanual, Graphic3d_Texture1D)
|
||||
|
||||
//! This class provides the implementation of a manual 1D texture.
|
||||
//! you MUST provides texture coordinates on your facets if you want to see your texture.
|
||||
class Graphic3d_Texture1Dmanual : public Graphic3d_Texture1D
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates a texture from the file FileName.
|
||||
Standard_EXPORT Graphic3d_Texture1Dmanual(const TCollection_AsciiString& theFileName);
|
||||
|
||||
//! Create a texture from a predefined texture name set.
|
||||
Standard_EXPORT Graphic3d_Texture1Dmanual(const Graphic3d_NameOfTexture1D theNOT);
|
||||
|
||||
//! Creates a texture from the pixmap.
|
||||
Standard_EXPORT Graphic3d_Texture1Dmanual(const Image_PixMap_Handle& thePixMap);
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Graphic3d_Texture1Dmanual,Graphic3d_Texture1D)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Graphic3d_Texture1Dmanual_HeaderFile
|
@@ -1,63 +0,0 @@
|
||||
-- Created on: 1997-07-28
|
||||
-- Created by: Pierre CHALAMET
|
||||
-- Copyright (c) 1997-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 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 License 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.
|
||||
|
||||
class Texture1Dsegment from Graphic3d
|
||||
|
||||
inherits Texture1D from Graphic3d
|
||||
|
||||
---Purpose: This class provides the implementation
|
||||
-- of a 1D texture applyable along a segment.
|
||||
-- You might use the SetSegment() method
|
||||
-- to set the way the texture is "streched" on facets.
|
||||
|
||||
uses
|
||||
|
||||
NameOfTexture1D from Graphic3d,
|
||||
AsciiString from TCollection,
|
||||
PixMap_Handle from Image
|
||||
|
||||
is
|
||||
|
||||
Create (theFileName : AsciiString from TCollection) returns Texture1Dsegment from Graphic3d;
|
||||
---Purpose: Creates a texture from a file
|
||||
|
||||
Create (theNOT : NameOfTexture1D from Graphic3d) returns Texture1Dsegment from Graphic3d;
|
||||
---Purpose: Creates a texture from a predefined texture name set.
|
||||
|
||||
Create (thePixMap : PixMap_Handle from Image) returns Texture1Dsegment from Graphic3d;
|
||||
---Purpose: Creates a texture from the pixmap.
|
||||
|
||||
SetSegment (me : mutable;
|
||||
theX1, theY1, theZ1 : ShortReal from Standard;
|
||||
theX2, theY2, theZ2 : ShortReal from Standard);
|
||||
---Purpose: Sets the texture application bounds. Defines the way
|
||||
-- the texture is stretched across facets.
|
||||
-- Default values are <0.0, 0.0, 0.0> , <0.0, 0.0, 1.0>
|
||||
|
||||
--
|
||||
-- inquire methods
|
||||
--
|
||||
Segment (me;
|
||||
theX1, theY1, theZ1 : out ShortReal from Standard;
|
||||
theX2, theY2, theZ2 : out ShortReal from Standard);
|
||||
---Purpose: Returns the values of the current segment X1, Y1, Z1 , X2, Y2, Z2.
|
||||
|
||||
fields
|
||||
|
||||
myX1, myY1, myZ1 : ShortReal from Standard;
|
||||
myX2, myY2, myZ2 : ShortReal from Standard;
|
||||
|
||||
end Texture1Dsegment;
|
@@ -14,9 +14,12 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Graphic3d_Texture1Dsegment.ixx>
|
||||
#include <Graphic3d_TypeOfTextureMode.hxx>
|
||||
|
||||
#include <Graphic3d_Texture1Dsegment.hxx>
|
||||
#include <Graphic3d_TextureParams.hxx>
|
||||
#include <Graphic3d_TypeOfTextureMode.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
// =======================================================================
|
||||
// function : Graphic3d_Texture1Dsegment
|
||||
|
89
src/Graphic3d/Graphic3d_Texture1Dsegment.hxx
Normal file
89
src/Graphic3d/Graphic3d_Texture1Dsegment.hxx
Normal file
@@ -0,0 +1,89 @@
|
||||
// Created on: 1997-07-28
|
||||
// Created by: Pierre CHALAMET
|
||||
// Copyright (c) 1997-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 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 License 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_Texture1Dsegment_HeaderFile
|
||||
#define _Graphic3d_Texture1Dsegment_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Standard_ShortReal.hxx>
|
||||
#include <Graphic3d_Texture1D.hxx>
|
||||
#include <Graphic3d_NameOfTexture1D.hxx>
|
||||
#include <Image_PixMap_Handle.hxx>
|
||||
class TCollection_AsciiString;
|
||||
|
||||
|
||||
class Graphic3d_Texture1Dsegment;
|
||||
DEFINE_STANDARD_HANDLE(Graphic3d_Texture1Dsegment, Graphic3d_Texture1D)
|
||||
|
||||
//! This class provides the implementation
|
||||
//! of a 1D texture applyable along a segment.
|
||||
//! You might use the SetSegment() method
|
||||
//! to set the way the texture is "streched" on facets.
|
||||
class Graphic3d_Texture1Dsegment : public Graphic3d_Texture1D
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
//! Creates a texture from a file
|
||||
Standard_EXPORT Graphic3d_Texture1Dsegment(const TCollection_AsciiString& theFileName);
|
||||
|
||||
//! Creates a texture from a predefined texture name set.
|
||||
Standard_EXPORT Graphic3d_Texture1Dsegment(const Graphic3d_NameOfTexture1D theNOT);
|
||||
|
||||
//! Creates a texture from the pixmap.
|
||||
Standard_EXPORT Graphic3d_Texture1Dsegment(const Image_PixMap_Handle& thePixMap);
|
||||
|
||||
//! Sets the texture application bounds. Defines the way
|
||||
//! the texture is stretched across facets.
|
||||
//! Default values are <0.0, 0.0, 0.0> , <0.0, 0.0, 1.0>
|
||||
Standard_EXPORT void SetSegment (const Standard_ShortReal theX1, const Standard_ShortReal theY1, const Standard_ShortReal theZ1, const Standard_ShortReal theX2, const Standard_ShortReal theY2, const Standard_ShortReal theZ2);
|
||||
|
||||
//! Returns the values of the current segment X1, Y1, Z1 , X2, Y2, Z2.
|
||||
Standard_EXPORT void Segment (Standard_ShortReal& theX1, Standard_ShortReal& theY1, Standard_ShortReal& theZ1, Standard_ShortReal& theX2, Standard_ShortReal& theY2, Standard_ShortReal& theZ2) const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Graphic3d_Texture1Dsegment,Graphic3d_Texture1D)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_ShortReal myX1;
|
||||
Standard_ShortReal myY1;
|
||||
Standard_ShortReal myZ1;
|
||||
Standard_ShortReal myX2;
|
||||
Standard_ShortReal myY2;
|
||||
Standard_ShortReal myZ2;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Graphic3d_Texture1Dsegment_HeaderFile
|
@@ -1,67 +0,0 @@
|
||||
-- Created on: 1997-07-28
|
||||
-- Created by: Pierre CHALAMET
|
||||
-- Copyright (c) 1997-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 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 License 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.
|
||||
|
||||
deferred class Texture2D from Graphic3d
|
||||
|
||||
inherits TextureMap from Graphic3d
|
||||
|
||||
---Purpose: This abstract class for managing 2D textures
|
||||
|
||||
uses
|
||||
|
||||
TypeOfTexture from Graphic3d,
|
||||
NameOfTexture2D from Graphic3d,
|
||||
AsciiString from TCollection,
|
||||
PixMap_Handle from Image
|
||||
|
||||
raises
|
||||
|
||||
OutOfRange from Standard
|
||||
|
||||
is
|
||||
|
||||
Initialize (theFileName : AsciiString from TCollection;
|
||||
theType : TypeOfTexture from Graphic3d);
|
||||
|
||||
Initialize (theName : NameOfTexture2D from Graphic3d;
|
||||
theType : TypeOfTexture from Graphic3d);
|
||||
|
||||
Initialize (thePixMap : PixMap_Handle from Image;
|
||||
theType : TypeOfTexture from Graphic3d);
|
||||
|
||||
Name (me) returns NameOfTexture2D from Graphic3d;
|
||||
---Purpose:
|
||||
-- Returns the name of the predefined textures or NOT_2D_UNKNOWN
|
||||
-- when the name is given as a filename.
|
||||
---Level: Public
|
||||
|
||||
NumberOfTextures (myclass) returns Integer from Standard;
|
||||
---Purpose:
|
||||
-- Returns the number of predefined textures.
|
||||
---Level: Public
|
||||
|
||||
TextureName (myclass; theRank: Integer from Standard) returns AsciiString from TCollection
|
||||
raises OutOfRange from Standard;
|
||||
---Purpose:
|
||||
-- Returns the name of the predefined texture of rank <aRank>
|
||||
---Trigger: when <aRank> is < 1 or > NumberOfTextures.
|
||||
---Level: Public
|
||||
|
||||
fields
|
||||
|
||||
myName : NameOfTexture2D from Graphic3d;
|
||||
|
||||
end Texture2D;
|
@@ -14,7 +14,10 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Graphic3d_Texture2D.ixx>
|
||||
|
||||
#include <Graphic3d_Texture2D.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
static const char *NameOfTexture_to_FileName[] =
|
||||
|
85
src/Graphic3d/Graphic3d_Texture2D.hxx
Normal file
85
src/Graphic3d/Graphic3d_Texture2D.hxx
Normal file
@@ -0,0 +1,85 @@
|
||||
// Created on: 1997-07-28
|
||||
// Created by: Pierre CHALAMET
|
||||
// Copyright (c) 1997-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 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 License 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_Texture2D_HeaderFile
|
||||
#define _Graphic3d_Texture2D_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Graphic3d_NameOfTexture2D.hxx>
|
||||
#include <Graphic3d_TextureMap.hxx>
|
||||
#include <Graphic3d_TypeOfTexture.hxx>
|
||||
#include <Image_PixMap_Handle.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
class Standard_OutOfRange;
|
||||
class TCollection_AsciiString;
|
||||
|
||||
|
||||
class Graphic3d_Texture2D;
|
||||
DEFINE_STANDARD_HANDLE(Graphic3d_Texture2D, Graphic3d_TextureMap)
|
||||
|
||||
//! This abstract class for managing 2D textures
|
||||
class Graphic3d_Texture2D : public Graphic3d_TextureMap
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
|
||||
|
||||
//! Returns the name of the predefined textures or NOT_2D_UNKNOWN
|
||||
//! when the name is given as a filename.
|
||||
Standard_EXPORT Graphic3d_NameOfTexture2D Name() const;
|
||||
|
||||
|
||||
//! Returns the number of predefined textures.
|
||||
Standard_EXPORT static Standard_Integer NumberOfTextures();
|
||||
|
||||
|
||||
//! Returns the name of the predefined texture of rank <aRank>
|
||||
Standard_EXPORT static TCollection_AsciiString TextureName (const Standard_Integer theRank);
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTI(Graphic3d_Texture2D,Graphic3d_TextureMap)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
Standard_EXPORT Graphic3d_Texture2D(const TCollection_AsciiString& theFileName, const Graphic3d_TypeOfTexture theType);
|
||||
|
||||
Standard_EXPORT Graphic3d_Texture2D(const Graphic3d_NameOfTexture2D theName, const Graphic3d_TypeOfTexture theType);
|
||||
|
||||
Standard_EXPORT Graphic3d_Texture2D(const Image_PixMap_Handle& thePixMap, const Graphic3d_TypeOfTexture theType);
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Graphic3d_NameOfTexture2D myName;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _Graphic3d_Texture2D_HeaderFile
|
@@ -1,42 +0,0 @@
|
||||
-- Created on: 1997-07-28
|
||||
-- Created by: Pierre CHALAMET
|
||||
-- Copyright (c) 1997-1999 Matra Datavision
|
||||
-- Copyright (c) 1999-2014 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 License 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.
|
||||
|
||||
class Texture2Dmanual from Graphic3d
|
||||
|
||||
inherits Texture2D from Graphic3d
|
||||
|
||||
---Purpose: This class defined a manual texture 2D
|
||||
-- facets MUST define texture coordinate
|
||||
-- if you want to see somethings on.
|
||||
|
||||
uses
|
||||
|
||||
NameOfTexture2D from Graphic3d,
|
||||
AsciiString from TCollection,
|
||||
PixMap_Handle from Image
|
||||
|
||||
is
|
||||
|
||||
Create (theFileName : AsciiString from TCollection) returns Texture2Dmanual from Graphic3d;
|
||||
---Purpose: Creates a texture from a file
|
||||
|
||||
Create (theNOT : NameOfTexture2D from Graphic3d) returns Texture2Dmanual from Graphic3d;
|
||||
---Purpose: Creates a texture from a predefined texture name set.
|
||||
|
||||
Create (thePixMap : PixMap_Handle from Image) returns Texture2Dmanual from Graphic3d;
|
||||
---Purpose: Creates a texture from the pixmap.
|
||||
|
||||
end Texture2Dmanual;
|
@@ -14,9 +14,12 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Graphic3d_Texture2Dmanual.ixx>
|
||||
#include <Graphic3d_TypeOfTextureMode.hxx>
|
||||
|
||||
#include <Graphic3d_Texture2Dmanual.hxx>
|
||||
#include <Graphic3d_TextureParams.hxx>
|
||||
#include <Graphic3d_TypeOfTextureMode.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
// =======================================================================
|
||||
// function : Graphic3d_Texture2Dmanual
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user