Lagrange
Loading...
Searching...
No Matches
ExactPredicates.h
1/*
2 * Copyright 2016 Adobe. All rights reserved.
3 * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License. You may obtain a copy
5 * of the License at http://www.apache.org/licenses/LICENSE-2.0
6 *
7 * Unless required by applicable law or agreed to in writing, software distributed under
8 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9 * OF ANY KIND, either express or implied. See the License for the specific language
10 * governing permissions and limitations under the License.
11 */
12#pragma once
13
14#include <lagrange/api.h>
15#include <lagrange/common.h>
16
17#include <memory>
18#include <string>
19
20namespace lagrange {
21
26
27class LA_CORE_API ExactPredicates
28{
29public:
38 static std::unique_ptr<ExactPredicates> create(const std::string& engine);
39
40public:
41 ExactPredicates() = default;
42 virtual ~ExactPredicates() = default;
43
44public:
55 virtual short collinear3D(const double p1[3], const double p2[3], const double p3[3]) const;
56
68 virtual short orient2D(const double p1[2], const double p2[2], const double p3[2]) const = 0;
69
83 virtual short orient3D(
84 const double p1[3],
85 const double p2[3],
86 const double p3[3],
87 const double p4[3]) const = 0;
88
102 virtual short incircle(
103 const double p1[2],
104 const double p2[2],
105 const double p3[2],
106 const double p4[2]) const = 0;
107
123 virtual short insphere(
124 const double p1[3],
125 const double p2[3],
126 const double p3[3],
127 const double p4[3],
128 const double p5[3]) const = 0;
129};
130
131
132} // namespace lagrange
static std::unique_ptr< ExactPredicates > create(const std::string &engine)
Factory method to create an exact predicate engine.
Definition ExactPredicates.cpp:20
virtual short orient2D(const double p1[2], const double p2[2], const double p3[2]) const =0
Exact 2D orientation test.
virtual short orient3D(const double p1[3], const double p2[3], const double p3[3], const double p4[3]) const =0
Exact 3D orientation test.
virtual short collinear3D(const double p1[3], const double p2[3], const double p3[3]) const
Tests whether p1, p2, and p3 are collinear in 3D.
Definition ExactPredicates.cpp:31
virtual short insphere(const double p1[3], const double p2[3], const double p3[3], const double p4[3], const double p5[3]) const =0
Exact 3D insphere test.
virtual short incircle(const double p1[2], const double p2[2], const double p3[2], const double p4[2]) const =0
Exact 2D incircle test.
Main namespace for Lagrange.