NDEVR
API Documentation
CoordinateConverter.h
1/*--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: Design
28File: CoordinateConverter
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include <NDEVR/SoftwareService.h>
34#include <NDEVR/CoordinateProjection.h>
35#include "DLLInfo.h"
36namespace NDEVR
37{
38 class File;
39
46 {
47 public:
53 CoordinateConverter(const CoordinateProjection& to_projection, const CoordinateProjection& from_projection)
54 : m_from_projection(from_projection)
55 , m_to_projection(to_projection)
56 {
57 }
58
76 virtual void setSourceProjection(const CoordinateProjection& from_projection) = 0;
81 virtual void setDestinationProjection(const CoordinateProjection& to_projection) = 0;
88 virtual Vertex<3, fltp08> convert(const Vertex<3, fltp08>& location, bool inverse = false) const = 0;
95 virtual Vertex<2, fltp08> convert(const Vertex<2, fltp08>& location, bool inverse = false) const = 0;
102 virtual Bounds<3, fltp08> convert(const Bounds<3, fltp08>& location, bool inverse = false) const = 0;
109 virtual Bounds<2, fltp08> convert(const Bounds<2, fltp08>& location, bool inverse = false) const = 0;
116 virtual Matrix<fltp08> convert(const Matrix<fltp08>& location, bool inverse = false) const = 0;
117 protected:
120 };
121
127 {
128 public:
135 virtual CoordinateConverter* createConverter(const CoordinateProjection& to_projection, const CoordinateProjection& from_projection) = 0;
141 protected:
142 NDEVR_DESIGN_API static CoordinateConverterFactory* s_converter;
143 };
144}
145
146
147
A specification of upper and lower bounds in N-dimensions.
Definition Bounds.hpp:54
Allows for the creation of Coordinate spaces.
static CoordinateConverterFactory * DefaultFactory()
Returns the default CoordinateConverterFactory instance.
virtual CoordinateConverter * createConverter(const CoordinateProjection &to_projection, const CoordinateProjection &from_projection)=0
Creates a new CoordinateConverter for converting between two projections.
static CoordinateConverterFactory * s_converter
The global default converter factory instance.
Forward declaration of the File class.
virtual Matrix< fltp08 > convert(const Matrix< fltp08 > &location, bool inverse=false) const =0
Converts a transformation matrix from one projection to another.
CoordinateProjection fromProjection()
Returns the source coordinate projection.
virtual void setDestinationProjection(const CoordinateProjection &to_projection)=0
Sets the destination coordinate projection.
virtual Vertex< 2, fltp08 > convert(const Vertex< 2, fltp08 > &location, bool inverse=false) const =0
Converts a 2D vertex from one projection to another.
CoordinateProjection m_from_projection
The source coordinate projection to convert from.
virtual Bounds< 2, fltp08 > convert(const Bounds< 2, fltp08 > &location, bool inverse=false) const =0
Converts a 2D bounding box from one projection to another.
CoordinateProjection m_to_projection
The destination coordinate projection to convert into.
CoordinateConverter(const CoordinateProjection &to_projection, const CoordinateProjection &from_projection)
Constructs a CoordinateConverter with the given source and destination projections.
virtual ~CoordinateConverter()
Virtual destructor for safe polymorphic deletion.
virtual Bounds< 3, fltp08 > convert(const Bounds< 3, fltp08 > &location, bool inverse=false) const =0
Converts a 3D bounding box from one projection to another.
virtual void setSourceProjection(const CoordinateProjection &from_projection)=0
Sets the source coordinate projection.
virtual Vertex< 3, fltp08 > convert(const Vertex< 3, fltp08 > &location, bool inverse=false) const =0
Converts a 3D vertex from one projection to another.
CoordinateProjection toProjection()
Returns the destination coordinate projection.
Logic for reading or writing to a file as well as navigating filesystems or other common file operati...
Definition File.h:53
Templated logic for doing matrix multiplication.
Definition Matrix.hpp:182
Software Service Managers take a Software service to modify the behavior of the software.
Base interface for services that extend or modify software behavior through modules.
A point in N-dimensional space, used primarily for spatial location information.
Definition Vertex.hpp:44
The primary namespace for the NDEVR SDK.
Basic data about a particular coordinate projection.