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:
7
src/StlAPI/FILES
Normal file
7
src/StlAPI/FILES
Normal file
@@ -0,0 +1,7 @@
|
||||
StlAPI.cxx
|
||||
StlAPI.hxx
|
||||
StlAPI_ErrorStatus.hxx
|
||||
StlAPI_Reader.cxx
|
||||
StlAPI_Reader.hxx
|
||||
StlAPI_Writer.cxx
|
||||
StlAPI_Writer.hxx
|
@@ -1,51 +0,0 @@
|
||||
-- Created on: 1997-05-13
|
||||
-- Created by: Fabien REUTER
|
||||
-- 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.
|
||||
|
||||
package StlAPI
|
||||
|
||||
---Purpose : Offers the API for STL data manipulation.
|
||||
--
|
||||
|
||||
uses
|
||||
|
||||
TopoDS,
|
||||
StlMesh
|
||||
|
||||
is
|
||||
enumeration ErrorStatus is
|
||||
---Purpose: Set of statuses to indicate a type of the error
|
||||
-- occurred during data retrieving and writing operations.
|
||||
StatusOK,
|
||||
MeshIsEmpty,
|
||||
CannotOpenFile
|
||||
|
||||
end ErrorStatus;
|
||||
|
||||
class Writer;
|
||||
class Reader;
|
||||
|
||||
Write(aShape : in Shape from TopoDS;
|
||||
aFile : in CString from Standard;
|
||||
aAsciiMode : in Boolean from Standard = Standard_True) returns ErrorStatus from StlAPI;
|
||||
---Purpose : Convert and write shape to STL format.
|
||||
-- file is written in binary if aAsciiMode is False
|
||||
-- otherwise it is written in Ascii (by default)
|
||||
|
||||
Read(aShape : in out Shape from TopoDS;
|
||||
aFile : CString from Standard);
|
||||
---Purpose : Create a shape from a STL format.
|
||||
|
||||
end StlAPI;
|
@@ -11,9 +11,11 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <StlAPI.ixx>
|
||||
#include <StlAPI_Writer.hxx>
|
||||
|
||||
#include <StlAPI.hxx>
|
||||
#include <StlAPI_Reader.hxx>
|
||||
#include <StlAPI_Writer.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
StlAPI_ErrorStatus StlAPI::Write(const TopoDS_Shape& aShape,
|
||||
const Standard_CString aFile,
|
||||
|
73
src/StlAPI/StlAPI.hxx
Normal file
73
src/StlAPI/StlAPI.hxx
Normal file
@@ -0,0 +1,73 @@
|
||||
// Created on: 1997-05-13
|
||||
// Created by: Fabien REUTER
|
||||
// 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 _StlAPI_HeaderFile
|
||||
#define _StlAPI_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <StlAPI_ErrorStatus.hxx>
|
||||
#include <Standard_CString.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
class TopoDS_Shape;
|
||||
class StlAPI_Writer;
|
||||
class StlAPI_Reader;
|
||||
|
||||
|
||||
//! Offers the API for STL data manipulation.
|
||||
class StlAPI
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Convert and write shape to STL format.
|
||||
//! file is written in binary if aAsciiMode is False
|
||||
//! otherwise it is written in Ascii (by default)
|
||||
Standard_EXPORT static StlAPI_ErrorStatus Write (const TopoDS_Shape& aShape, const Standard_CString aFile, const Standard_Boolean aAsciiMode = Standard_True);
|
||||
|
||||
//! Create a shape from a STL format.
|
||||
Standard_EXPORT static void Read (TopoDS_Shape& aShape, const Standard_CString aFile);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
friend class StlAPI_Writer;
|
||||
friend class StlAPI_Reader;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _StlAPI_HeaderFile
|
29
src/StlAPI/StlAPI_ErrorStatus.hxx
Normal file
29
src/StlAPI/StlAPI_ErrorStatus.hxx
Normal file
@@ -0,0 +1,29 @@
|
||||
// Created on: 1997-05-13
|
||||
// Created by: Fabien REUTER
|
||||
// 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 _StlAPI_ErrorStatus_HeaderFile
|
||||
#define _StlAPI_ErrorStatus_HeaderFile
|
||||
|
||||
//! Set of statuses to indicate a type of the error
|
||||
//! occurred during data retrieving and writing operations.
|
||||
enum StlAPI_ErrorStatus
|
||||
{
|
||||
StlAPI_StatusOK,
|
||||
StlAPI_MeshIsEmpty,
|
||||
StlAPI_CannotOpenFile
|
||||
};
|
||||
|
||||
#endif // _StlAPI_ErrorStatus_HeaderFile
|
@@ -1,28 +0,0 @@
|
||||
-- Created on: 2000-06-23
|
||||
-- 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 Reader from StlAPI
|
||||
|
||||
---Purpose: Reading from stereolithography format.
|
||||
|
||||
uses
|
||||
Shape from TopoDS,
|
||||
Mesh from StlMesh
|
||||
is
|
||||
Create;
|
||||
|
||||
Read(me : in out; aShape : in out Shape from TopoDS; aFileName : CString from Standard);
|
||||
|
||||
end Reader;
|
@@ -11,25 +11,25 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <StlAPI_Reader.ixx>
|
||||
#include <RWStl.hxx>
|
||||
#include <StlMesh_Mesh.hxx>
|
||||
#include <OSD_Path.hxx>
|
||||
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRepBuilderAPI_MakeVertex.hxx>
|
||||
#include <BRepBuilderAPI_MakePolygon.hxx>
|
||||
#include <BRepBuilderAPI_MakeFace.hxx>
|
||||
#include <BRepBuilderAPI_MakePolygon.hxx>
|
||||
#include <BRepBuilderAPI_MakeVertex.hxx>
|
||||
#include <BRepBuilderAPI_Sewing.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <TopoDS_Compound.hxx>
|
||||
#include <TopoDS_Wire.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Shell.hxx>
|
||||
#include <OSD_Path.hxx>
|
||||
#include <RWStl.hxx>
|
||||
#include <StlAPI_Reader.hxx>
|
||||
#include <StlMesh_Mesh.hxx>
|
||||
#include <StlMesh_MeshExplorer.hxx>
|
||||
|
||||
|
||||
#include <TopoDS_Compound.hxx>
|
||||
#include <TopoDS_Edge.hxx>
|
||||
#include <TopoDS_Face.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <TopoDS_Shell.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopoDS_Wire.hxx>
|
||||
|
||||
StlAPI_Reader::StlAPI_Reader() {}
|
||||
|
||||
|
62
src/StlAPI/StlAPI_Reader.hxx
Normal file
62
src/StlAPI/StlAPI_Reader.hxx
Normal file
@@ -0,0 +1,62 @@
|
||||
// Created on: 2000-06-23
|
||||
// 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 _StlAPI_Reader_HeaderFile
|
||||
#define _StlAPI_Reader_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_CString.hxx>
|
||||
class TopoDS_Shape;
|
||||
|
||||
|
||||
//! Reading from stereolithography format.
|
||||
class StlAPI_Reader
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
Standard_EXPORT StlAPI_Reader();
|
||||
|
||||
Standard_EXPORT void Read (TopoDS_Shape& aShape, const Standard_CString aFileName);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _StlAPI_Reader_HeaderFile
|
@@ -1,49 +0,0 @@
|
||||
-- Created on: 2000-06-23
|
||||
-- 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 StlAPI
|
||||
|
||||
---Purpose: This class creates and writes
|
||||
-- STL files from Open CASCADE shapes. An STL file can be
|
||||
-- written to an existing STL file or to a new one..
|
||||
|
||||
uses
|
||||
Shape from TopoDS,
|
||||
Mesh from StlMesh,
|
||||
ErrorStatus from StlAPI
|
||||
is
|
||||
Create;
|
||||
---Purpose: Creates a writer object with
|
||||
-- default parameters: ASCIIMode.
|
||||
|
||||
ASCIIMode(me: in out) returns Boolean;
|
||||
---C++: return &
|
||||
---Purpose: Returns the address to the
|
||||
-- flag defining the mode for writing the file. This address
|
||||
-- may be used to either read or change the flag.
|
||||
-- If the mode returns True (default value) the generated
|
||||
-- file is an ASCII file. If the mode returns False, the
|
||||
-- generated file is a binary file.
|
||||
|
||||
Write(me : in out;
|
||||
aShape : Shape from TopoDS;
|
||||
aFileName : CString from Standard) returns ErrorStatus from StlAPI;
|
||||
---Purpose: Converts a given shape to STL format and writes it to file with a given filename.
|
||||
--- \return the error state.
|
||||
|
||||
fields
|
||||
theASCIIMode : Boolean from Standard;
|
||||
theStlMesh : Mesh from StlMesh;
|
||||
end Writer;
|
@@ -11,13 +11,15 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <StlAPI_Writer.ixx>
|
||||
#include <StlTransfer.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
#include <Bnd_Box.hxx>
|
||||
#include <RWStl.hxx>
|
||||
#include <BRepBndLib.hxx>
|
||||
#include <OSD_Path.hxx>
|
||||
#include <RWStl.hxx>
|
||||
#include <StlAPI_Writer.hxx>
|
||||
#include <StlMesh_Mesh.hxx>
|
||||
#include <StlTransfer.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
StlAPI_Writer::StlAPI_Writer()
|
||||
{
|
||||
|
81
src/StlAPI/StlAPI_Writer.hxx
Normal file
81
src/StlAPI/StlAPI_Writer.hxx
Normal file
@@ -0,0 +1,81 @@
|
||||
// Created on: 2000-06-23
|
||||
// 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 _StlAPI_Writer_HeaderFile
|
||||
#define _StlAPI_Writer_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_DefineAlloc.hxx>
|
||||
#include <Standard_Handle.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <StlAPI_ErrorStatus.hxx>
|
||||
#include <Standard_CString.hxx>
|
||||
class StlMesh_Mesh;
|
||||
class TopoDS_Shape;
|
||||
|
||||
|
||||
//! This class creates and writes
|
||||
//! STL files from Open CASCADE shapes. An STL file can be
|
||||
//! written to an existing STL file or to a new one..
|
||||
class StlAPI_Writer
|
||||
{
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Creates a writer object with
|
||||
//! default parameters: ASCIIMode.
|
||||
Standard_EXPORT StlAPI_Writer();
|
||||
|
||||
//! Returns the address to the
|
||||
//! flag defining the mode for writing the file. This address
|
||||
//! may be used to either read or change the flag.
|
||||
//! If the mode returns True (default value) the generated
|
||||
//! file is an ASCII file. If the mode returns False, the
|
||||
//! generated file is a binary file.
|
||||
Standard_EXPORT Standard_Boolean& ASCIIMode();
|
||||
|
||||
//! Converts a given shape to STL format and writes it to file with a given filename.
|
||||
//! \return the error state.
|
||||
Standard_EXPORT StlAPI_ErrorStatus Write (const TopoDS_Shape& aShape, const Standard_CString aFileName);
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
Standard_Boolean theASCIIMode;
|
||||
Handle(StlMesh_Mesh) theStlMesh;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // _StlAPI_Writer_HeaderFile
|
Reference in New Issue
Block a user