G4OCCT 0.1.0
Geant4 interface to Open CASCADE Technology (OCCT) geometry definitions
Loading...
Searching...
No Matches
G4OCCTSolid.hh
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-2.1-or-later
2// Copyright (C) 2026 G4OCCT Contributors
3
6
7#ifndef G4OCCT_G4OCCTSolid_hh
8#define G4OCCT_G4OCCTSolid_hh
9
10#include <G4String.hh>
11#include <G4ThreeVector.hh>
12#include <G4VSolid.hh>
13
14#include <iosfwd>
15#include <memory>
16#include <string>
17
18class G4Polyhedron;
19class TopoDS_Shape;
20class G4VGraphicsScene;
21
31class G4OCCTSolid : public G4VSolid {
32public:
40 G4OCCTSolid(const G4String& name, const TopoDS_Shape& shape);
41
45 ~G4OCCTSolid() override;
46
59 static G4OCCTSolid* FromSTEP(const G4String& name, const std::string& path);
60
64 EInside Inside(const G4ThreeVector& p) const override;
65
72 G4ThreeVector SurfaceNormal(const G4ThreeVector& p) const override;
73
83 G4double DistanceToIn(const G4ThreeVector& p, const G4ThreeVector& v) const override;
84
91 G4double DistanceToIn(const G4ThreeVector& p) const override;
92
105 G4double DistanceToOut(const G4ThreeVector& p, const G4ThreeVector& v,
106 const G4bool calcNorm = false, G4bool* validNorm = nullptr,
107 G4ThreeVector* n = nullptr) const override;
108
115 G4double DistanceToOut(const G4ThreeVector& p) const override;
116
123 G4ThreeVector GetPointOnSurface() const override;
124
130 G4double ExactDistanceToIn(const G4ThreeVector& p) const;
131
137 G4double ExactDistanceToOut(const G4ThreeVector& p) const;
138
145 G4double GetCubicVolume() override;
146
153 G4double GetSurfaceArea() override;
154
158 G4GeometryType GetEntityType() const override;
159
163 G4VisExtent GetExtent() const override;
164
168 void BoundingLimits(G4ThreeVector& pMin, G4ThreeVector& pMax) const override;
169
174 G4bool CalculateExtent(const EAxis pAxis, const G4VoxelLimits& pVoxelLimit,
175 const G4AffineTransform& pTransform, G4double& pMin,
176 G4double& pMax) const override;
177
181 void DescribeYourselfTo(G4VGraphicsScene& scene) const override;
182
188 G4Polyhedron* CreatePolyhedron() const override;
189
193 std::ostream& StreamInfo(std::ostream& os) const override;
194
198 const TopoDS_Shape& GetOCCTShape() const;
199
211 void SetOCCTShape(const TopoDS_Shape& shape);
212
213private:
214 class Impl;
215 std::unique_ptr<Impl> fImpl;
216};
217
218#endif // G4OCCT_G4OCCTSolid_hh
Geant4 solid wrapping an Open CASCADE Technology (OCCT) TopoDS_Shape.
G4double ExactDistanceToOut(const G4ThreeVector &p) const
EInside Inside(const G4ThreeVector &p) const override
G4double GetCubicVolume() override
G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=false, G4bool *validNorm=nullptr, G4ThreeVector *n=nullptr) const override
G4Polyhedron * CreatePolyhedron() const override
G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const override
void SetOCCTShape(const TopoDS_Shape &shape)
void BoundingLimits(G4ThreeVector &pMin, G4ThreeVector &pMax) const override
G4ThreeVector SurfaceNormal(const G4ThreeVector &p) const override
G4bool CalculateExtent(const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pMin, G4double &pMax) const override
~G4OCCTSolid() override
G4double GetSurfaceArea() override
G4GeometryType GetEntityType() const override
const TopoDS_Shape & GetOCCTShape() const
G4ThreeVector GetPointOnSurface() const override
G4VisExtent GetExtent() const override
std::ostream & StreamInfo(std::ostream &os) const override
static G4OCCTSolid * FromSTEP(const G4String &name, const std::string &path)
void DescribeYourselfTo(G4VGraphicsScene &scene) const override
G4double ExactDistanceToIn(const G4ThreeVector &p) const