1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-04 13:13:25 +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:
abv
2015-07-12 07:42:38 +03:00
parent 543a996496
commit 42cf5bc1ca
15354 changed files with 623957 additions and 509844 deletions

5
src/VrmlAPI/FILES Normal file
View File

@@ -0,0 +1,5 @@
VrmlAPI.cxx
VrmlAPI.hxx
VrmlAPI_RepresentationOfShape.hxx
VrmlAPI_Writer.cxx
VrmlAPI_Writer.hxx

View File

@@ -1,48 +0,0 @@
-- Created on: 2000-05-30
-- Created by: Sergey MOZOKHIN
-- 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.
package VrmlAPI
---Purpose: API for writing to VRML 1.0
uses
TopoDS,
VrmlConverter,
Vrml,
Quantity
is
enumeration RepresentationOfShape is
ShadedRepresentation,
WireFrameRepresentation,
BothRepresentation
end RepresentationOfShape;
---Purpose: Identifies the representation of the shape written
-- to a VRML file. The available options are :
-- - VrmlAPI_ShadedRepresentation :
-- the shape is translated with a shaded representation.
-- - VrmlAPI_WireFrameRepresentation :
-- the shape is translated with a wireframe representation.
-- - VrmlAPI_BothRepresentation : the shape is translated
-- to VRML format with both representations : shaded and
-- wireframe. This is the default option.
class Writer;
---Purpose: With help of this class user can change parameters of writing.
Write(aShape: Shape from TopoDS; aFileName: CString from Standard; aVersion: Integer = 2);
---Purpose: Converts the shape aShape to VRML format of the passed version and writes it
-- to the file identified by aFileName using default parameters.
end VrmlAPI;

View File

@@ -13,9 +13,10 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <VrmlAPI.ixx>
#include <VrmlAPI_Writer.hxx>
#include <TopoDS_Shape.hxx>
#include <VrmlAPI.hxx>
#include <VrmlAPI_Writer.hxx>
void VrmlAPI::Write(const TopoDS_Shape& aShape, const Standard_CString aFileName, const Standard_Integer aVersion) {
VrmlAPI_Writer writer;

66
src/VrmlAPI/VrmlAPI.hxx Normal file
View File

@@ -0,0 +1,66 @@
// Created on: 2000-05-30
// Created by: Sergey MOZOKHIN
// 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 _VrmlAPI_HeaderFile
#define _VrmlAPI_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_CString.hxx>
#include <Standard_Integer.hxx>
class TopoDS_Shape;
class VrmlAPI_Writer;
//! API for writing to VRML 1.0
class VrmlAPI
{
public:
DEFINE_STANDARD_ALLOC
//! With help of this class user can change parameters of writing.
//! Converts the shape aShape to VRML format of the passed version and writes it
//! to the file identified by aFileName using default parameters.
Standard_EXPORT static void Write (const TopoDS_Shape& aShape, const Standard_CString aFileName, const Standard_Integer aVersion = 2);
protected:
private:
friend class VrmlAPI_Writer;
};
#endif // _VrmlAPI_HeaderFile

View File

@@ -0,0 +1,35 @@
// Created on: 2000-05-30
// Created by: Sergey MOZOKHIN
// 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 _VrmlAPI_RepresentationOfShape_HeaderFile
#define _VrmlAPI_RepresentationOfShape_HeaderFile
//! Identifies the representation of the shape written
//! to a VRML file. The available options are :
//! - VrmlAPI_ShadedRepresentation :
//! the shape is translated with a shaded representation.
//! - VrmlAPI_WireFrameRepresentation :
//! the shape is translated with a wireframe representation.
//! - VrmlAPI_BothRepresentation : the shape is translated
//! to VRML format with both representations : shaded and
//! wireframe. This is the default option.
enum VrmlAPI_RepresentationOfShape
{
VrmlAPI_ShadedRepresentation,
VrmlAPI_WireFrameRepresentation,
VrmlAPI_BothRepresentation
};
#endif // _VrmlAPI_RepresentationOfShape_HeaderFile

View File

@@ -1,124 +0,0 @@
-- Created on: 2000-06-20
-- Created by: Sergey MOZOKHIN
-- 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.
class Writer from VrmlAPI
---Purpose: Creates and writes VRML files from Open
-- CASCADE shapes. A VRML file can be written to
-- an existing VRML file or to a new one.
uses
Shape from TopoDS,
Drawer from VrmlConverter,
Projector from VrmlConverter,
Material from Vrml,
Length from Quantity,
HArray1OfColor from Quantity,
RepresentationOfShape from VrmlAPI
is
Create returns Writer from VrmlAPI;
---Purpose: Creates a writer object with default parameters.
ResetToDefaults(me : in out);
---Purpose: Resets all parameters (representation, deflection)
-- to their default values..
Drawer(me) returns Drawer from VrmlConverter;
---Purpose: Returns drawer object
SetDeflection(me : in out; aDef : Real from Standard);
---Purpose: Sets the deflection aDef of
-- the mesh algorithm which is used to compute the shaded
-- representation of the translated shape. The default
-- value is -1. When the deflection value is less than
-- 0, the deflection is calculated from the relative
-- size of the shaped.
SetRepresentation(me : in out; aRep : RepresentationOfShape from VrmlAPI);
---Purpose: Sets the representation of the
-- shape aRep which is written to the VRML file. The three options are :
-- - shaded
-- - wireframe
-- - both shaded and wireframe (default)
-- defined through the VrmlAPI_RepresentationOfShape enumeration.
SetTransparencyToMaterial(me : in out; aMaterial : in out Material from Vrml;
aTransparency : Real from Standard);
---Purpose: Set transparency to given material
SetShininessToMaterial(me : in out; aMaterial : in out Material from Vrml;
aShininess : Real from Standard);
SetAmbientColorToMaterial(me : in out ; aMaterial : in out Material from Vrml;
Color : HArray1OfColor from Quantity);
SetDiffuseColorToMaterial(me : in out ; aMaterial : in out Material from Vrml;
Color : HArray1OfColor from Quantity);
SetSpecularColorToMaterial(me : in out; aMaterial : in out Material from Vrml;
Color : HArray1OfColor from Quantity);
SetEmissiveColorToMaterial(me : in out ; aMaterial : in out Material from Vrml;
Color : HArray1OfColor from Quantity);
----------------- Returns fields of class --------------------------------------
GetRepresentation(me) returns RepresentationOfShape from VrmlAPI;
---Purpose: Returns the representation of the shape which is
-- written to the VRML file. Types of representation are set through the
-- VrmlAPI_RepresentationOfShape enumeration.
GetFrontMaterial(me) returns Material from Vrml;
GetPointsMaterial(me) returns Material from Vrml;
GetUisoMaterial(me) returns Material from Vrml;
GetVisoMaterial(me) returns Material from Vrml;
GetLineMaterial(me) returns Material from Vrml;
GetWireMaterial(me) returns Material from Vrml;
GetFreeBoundsMaterial(me) returns Material from Vrml;
GetUnfreeBoundsMaterial(me) returns Material from Vrml;
Write(me; aShape : Shape from TopoDS; aFile : CString from Standard; aVersion: Integer = 2);
---Purpose: Converts the shape aShape to
-- VRML format of the passed version and writes it to the file identified by aFile.
write_v1(me; aShape: Shape from TopoDS; aFileName: CString from Standard)
is protected;
---Purpose: Converts the shape aShape to VRML format of version 1.0 and writes it
-- to the file identified by aFileName using default parameters.
write_v2(me; aShape: Shape from TopoDS; aFileName: CString from Standard)
is protected;
---Purpose: Converts the shape aShape to VRML format of version 2.0 and writes it
-- to the file identified by aFileName using default parameters.
fields
myRepresentation : RepresentationOfShape from VrmlAPI;
myDrawer : Drawer from VrmlConverter;
myDeflection : Real from Standard;
myPerespectiveCamera : Projector from VrmlConverter;
myOrthographicCamera : Projector from VrmlConverter;
myTransparency : Real;
myShininess : Real;
myFrontMaterial : Material from Vrml;
myPointsMaterial : Material from Vrml;
myUisoMaterial : Material from Vrml;
myVisoMaterial : Material from Vrml;
myLineMaterial : Material from Vrml;
myWireMaterial : Material from Vrml;
myFreeBoundsMaterial : Material from Vrml;
myUnfreeBoundsMaterial : Material from Vrml;
--Projection Vector
DX : Length from Quantity;
DY : Length from Quantity;
DZ : Length from Quantity;
--High Point Direction
XUp : Length from Quantity;
YUp : Length from Quantity;
ZUp : Length from Quantity;
--Focus
Focus : Length from Quantity;
end Writer;

View File

@@ -11,34 +11,36 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Standard_Stream.hxx>
#include <VrmlAPI_Writer.ixx>
#include <Vrml_Material.hxx>
#include <Quantity_HArray1OfColor.hxx>
#include <TopoDS_Shape.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <BRep_Tool.hxx>
#include <OSD_OpenFile.hxx>
#include <OSD_Path.hxx>
#include <Poly_Triangulation.hxx>
#include <Quantity_HArray1OfColor.hxx>
#include <Standard_Stream.hxx>
#include <TColStd_HArray1OfReal.hxx>
#include <TopAbs_ShapeEnum.hxx>
#include <TopExp_Explorer.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Shape.hxx>
#include <TopTools_Array1OfShape.hxx>
#include <Vrml.hxx>
#include <Vrml_Group.hxx>
#include <Vrml_Instancing.hxx>
#include <Vrml_Material.hxx>
#include <Vrml_Separator.hxx>
#include <VrmlAPI_Writer.hxx>
#include <VrmlConverter_Drawer.hxx>
#include <VrmlConverter_IsoAspect.hxx>
#include <VrmlConverter_LineAspect.hxx>
#include <VrmlConverter_PointAspect.hxx>
#include <VrmlConverter_ShadingAspect.hxx>
#include <TopTools_Array1OfShape.hxx>
#include <Vrml.hxx>
#include <VrmlConverter_Projector.hxx>
#include <VrmlConverter_ShadedShape.hxx>
#include <Vrml_Group.hxx>
#include <Vrml_Instancing.hxx>
#include <Vrml_Separator.hxx>
#include <VrmlConverter_ShadingAspect.hxx>
#include <VrmlConverter_WFDeflectionShape.hxx>
#include <VrmlData_Scene.hxx>
#include <VrmlData_ShapeConvert.hxx>
#include <OSD_OpenFile.hxx>
#include <TopExp_Explorer.hxx>
#include <TopAbs_ShapeEnum.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Face.hxx>
#include <Poly_Triangulation.hxx>
#include <BRep_Tool.hxx>
VrmlAPI_Writer::VrmlAPI_Writer()
{

View File

@@ -0,0 +1,162 @@
// Created on: 2000-06-20
// Created by: Sergey MOZOKHIN
// 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 _VrmlAPI_Writer_HeaderFile
#define _VrmlAPI_Writer_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <VrmlAPI_RepresentationOfShape.hxx>
#include <Standard_Real.hxx>
#include <Quantity_Length.hxx>
#include <Quantity_HArray1OfColor.hxx>
#include <Standard_CString.hxx>
#include <Standard_Integer.hxx>
class VrmlConverter_Drawer;
class VrmlConverter_Projector;
class Vrml_Material;
class TopoDS_Shape;
//! Creates and writes VRML files from Open
//! CASCADE shapes. A VRML file can be written to
//! an existing VRML file or to a new one.
class VrmlAPI_Writer
{
public:
DEFINE_STANDARD_ALLOC
//! Creates a writer object with default parameters.
Standard_EXPORT VrmlAPI_Writer();
//! Resets all parameters (representation, deflection)
//! to their default values..
Standard_EXPORT void ResetToDefaults();
//! Returns drawer object
Standard_EXPORT Handle(VrmlConverter_Drawer) Drawer() const;
//! Sets the deflection aDef of
//! the mesh algorithm which is used to compute the shaded
//! representation of the translated shape. The default
//! value is -1. When the deflection value is less than
//! 0, the deflection is calculated from the relative
//! size of the shaped.
Standard_EXPORT void SetDeflection (const Standard_Real aDef);
//! Sets the representation of the
//! shape aRep which is written to the VRML file. The three options are :
//! - shaded
//! - wireframe
//! - both shaded and wireframe (default)
//! defined through the VrmlAPI_RepresentationOfShape enumeration.
Standard_EXPORT void SetRepresentation (const VrmlAPI_RepresentationOfShape aRep);
//! Set transparency to given material
Standard_EXPORT void SetTransparencyToMaterial (Handle(Vrml_Material)& aMaterial, const Standard_Real aTransparency);
Standard_EXPORT void SetShininessToMaterial (Handle(Vrml_Material)& aMaterial, const Standard_Real aShininess);
Standard_EXPORT void SetAmbientColorToMaterial (Handle(Vrml_Material)& aMaterial, const Handle(Quantity_HArray1OfColor)& Color);
Standard_EXPORT void SetDiffuseColorToMaterial (Handle(Vrml_Material)& aMaterial, const Handle(Quantity_HArray1OfColor)& Color);
Standard_EXPORT void SetSpecularColorToMaterial (Handle(Vrml_Material)& aMaterial, const Handle(Quantity_HArray1OfColor)& Color);
Standard_EXPORT void SetEmissiveColorToMaterial (Handle(Vrml_Material)& aMaterial, const Handle(Quantity_HArray1OfColor)& Color);
//! Returns the representation of the shape which is
//! written to the VRML file. Types of representation are set through the
//! VrmlAPI_RepresentationOfShape enumeration.
Standard_EXPORT VrmlAPI_RepresentationOfShape GetRepresentation() const;
Standard_EXPORT Handle(Vrml_Material) GetFrontMaterial() const;
Standard_EXPORT Handle(Vrml_Material) GetPointsMaterial() const;
Standard_EXPORT Handle(Vrml_Material) GetUisoMaterial() const;
Standard_EXPORT Handle(Vrml_Material) GetVisoMaterial() const;
Standard_EXPORT Handle(Vrml_Material) GetLineMaterial() const;
Standard_EXPORT Handle(Vrml_Material) GetWireMaterial() const;
Standard_EXPORT Handle(Vrml_Material) GetFreeBoundsMaterial() const;
Standard_EXPORT Handle(Vrml_Material) GetUnfreeBoundsMaterial() const;
//! Converts the shape aShape to
//! VRML format of the passed version and writes it to the file identified by aFile.
Standard_EXPORT void Write (const TopoDS_Shape& aShape, const Standard_CString aFile, const Standard_Integer aVersion = 2) const;
protected:
//! Converts the shape aShape to VRML format of version 1.0 and writes it
//! to the file identified by aFileName using default parameters.
Standard_EXPORT void write_v1 (const TopoDS_Shape& aShape, const Standard_CString aFileName) const;
//! Converts the shape aShape to VRML format of version 2.0 and writes it
//! to the file identified by aFileName using default parameters.
Standard_EXPORT void write_v2 (const TopoDS_Shape& aShape, const Standard_CString aFileName) const;
private:
VrmlAPI_RepresentationOfShape myRepresentation;
Handle(VrmlConverter_Drawer) myDrawer;
Standard_Real myDeflection;
Handle(VrmlConverter_Projector) myPerespectiveCamera;
Handle(VrmlConverter_Projector) myOrthographicCamera;
Standard_Real myTransparency;
Standard_Real myShininess;
Handle(Vrml_Material) myFrontMaterial;
Handle(Vrml_Material) myPointsMaterial;
Handle(Vrml_Material) myUisoMaterial;
Handle(Vrml_Material) myVisoMaterial;
Handle(Vrml_Material) myLineMaterial;
Handle(Vrml_Material) myWireMaterial;
Handle(Vrml_Material) myFreeBoundsMaterial;
Handle(Vrml_Material) myUnfreeBoundsMaterial;
Quantity_Length DX;
Quantity_Length DY;
Quantity_Length DZ;
Quantity_Length XUp;
Quantity_Length YUp;
Quantity_Length ZUp;
Quantity_Length Focus;
};
#endif // _VrmlAPI_Writer_HeaderFile