ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
SimpleTriangle.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 // Local
11 #include "GenericTriangle.h"
12 
13 namespace cloudViewer {
14 
16 
21 public:
23  SimpleRefTriangle() : A(nullptr), B(nullptr), C(nullptr) {}
24 
26 
31  const CCVector3* _B,
32  const CCVector3* _C)
33  : A(_A), B(_B), C(_C) {}
34 
35  // inherited methods (see GenericDistribution)
36  inline const CCVector3* _getA() const override { return A; }
37  inline const CCVector3* _getB() const override { return B; }
38  inline const CCVector3* _getC() const override { return C; }
39 
41  const CCVector3* A;
43  const CCVector3* B;
45  const CCVector3* C;
46 };
47 
49 
53 public:
55  SimpleTriangle() : A(0, 0, 0), B(0, 0, 0), C(0, 0, 0) {}
56 
58 
63  const CCVector3& _B,
64  const CCVector3& _C)
65  : A(_A), B(_B), C(_C) {}
66 
67  // inherited methods (see GenericDistribution)
68  inline const CCVector3* _getA() const override { return &A; }
69  inline const CCVector3* _getB() const override { return &B; }
70  inline const CCVector3* _getC() const override { return &C; }
71 
78 };
79 
80 } // namespace cloudViewer
#define CV_CORE_LIB_API
Definition: CVCoreLibWin.h:15
A generic triangle interface.
A simple triangle class.
const CCVector3 * _getB() const override
Returns the second vertex (B)
SimpleRefTriangle()
Default constructor.
SimpleRefTriangle(const CCVector3 *_A, const CCVector3 *_B, const CCVector3 *_C)
Constructor from 3 vertices (references to)
const CCVector3 * B
B vertex (ref)
const CCVector3 * _getC() const override
Returns the third vertex (C)
const CCVector3 * C
C vertex (ref)
const CCVector3 * A
A vertex (ref)
const CCVector3 * _getA() const override
Returns the first vertex (A)
A simple triangle class.
const CCVector3 * _getC() const override
Returns the third vertex (C)
const CCVector3 * _getB() const override
Returns the second vertex (B)
const CCVector3 * _getA() const override
Returns the first vertex (A)
SimpleTriangle()
Default constructor.
SimpleTriangle(const CCVector3 &_A, const CCVector3 &_B, const CCVector3 &_C)
Constructor from 3 vertices.
Generic file read and write utility for python interface.