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(double p1[3], double p2[3], double p3[3]) const;
56
68 virtual short orient2D(double p1[2], double p2[2], double p3[2]) const = 0;
69
83 virtual short orient3D(double p1[3], double p2[3], double p3[3], double p4[3]) const = 0;
84
98 virtual short incircle(double p1[2], double p2[2], double p3[2], double p4[2]) const = 0;
99
115 virtual short insphere(double p1[3], double p2[3], double p3[3], double p4[3], double p5[3])
116 const = 0;
117};
118
119
120} // 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(double p1[2], double p2[2], double p3[2]) const =0
Exact 2D orientation test.
virtual short collinear3D(double p1[3], double p2[3], double p3[3]) const
Tests whether p1, p2, and p3 are collinear in 3D.
Definition ExactPredicates.cpp:31
virtual short insphere(double p1[3], double p2[3], double p3[3], double p4[3], double p5[3]) const =0
Exact 3D insphere test.
virtual short incircle(double p1[2], double p2[2], double p3[2], double p4[2]) const =0
Exact 2D incircle test.
virtual short orient3D(double p1[3], double p2[3], double p3[3], double p4[3]) const =0
Exact 3D orientation test.
Main namespace for Lagrange.