ARX  1.0
The next-generation open source augmented reality toolkit.
Loading...
Searching...
No Matches
ARTrackable.h
Go to the documentation of this file.
1/*
2 * ARTrackable.h
3 * artoolkitX
4 *
5 * This file is part of artoolkitX.
6 *
7 * artoolkitX is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * artoolkitX is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with artoolkitX. If not, see <http://www.gnu.org/licenses/>.
19 *
20 * As a special exception, the copyright holders of this library give you
21 * permission to link this library with independent modules to produce an
22 * executable, regardless of the license terms of these independent modules, and to
23 * copy and distribute the resulting executable under terms of your choice,
24 * provided that you also meet, for each linked independent module, the terms and
25 * conditions of the license of that module. An independent module is a module
26 * which is neither derived from nor based on this library. If you modify this
27 * library, you may extend this exception to your version of the library, but you
28 * are not obligated to do so. If you do not wish to do so, delete this exception
29 * statement from your version.
30 *
31 * Copyright 2018 Realmax, Inc.
32 * Copyright 2015 Daqri, LLC.
33 * Copyright 2010-2015 ARToolworks, Inc.
34 *
35 * Author(s): Julian Looser, Philip Lamb
36 *
37 */
38
39#ifndef ARTRACKABLE_H
40#define ARTRACKABLE_H
41
42#include <ARX/AR/ar.h>
44
45#include <ARX/ARPattern.h>
46
47#include <vector>
48
49class ARController; // Forward declaration of owner.
50
55
56private:
58 ARdouble m_filterCutoffFrequency;
59 ARdouble m_filterSampleRate;
60
61protected:
67 void allocatePatterns(int count);
68
72 void freePatterns();
73
75
76public:
77
84 };
85
86 int UID;
88
89 // Inputs from subclasses.
91 bool visible;
92
93 // Output.
96
99
104
105 ARTrackable(const ARTrackable&) = delete;
107
108 virtual ~ARTrackable();
109
112
120 virtual bool update(const ARdouble transL2R[3][4] = NULL);
121
126 ARPattern* getPattern(int n);
127
128 // Filter control.
129 void setFiltered(bool flag);
130 bool isFiltered();
132 void setFilterSampleRate(ARdouble rate);
135
136};
137
138
139#endif // !ARTRACKABLE_H
artoolkitX core routines.
double ARdouble
Definition: ar.h:99
Provides filtering of transformation matrices (pose estimates).
Wrapper for artoolkitX functionality.
Definition: ARController.h:80
Encapsulates information about a sub-component of a marker useful for presentation to a user.
Definition: ARPattern.h:57
Base class for supported trackable types.
Definition: ARTrackable.h:54
void setFilterSampleRate(ARdouble rate)
Definition: ARTrackable.cpp:200
int UID
Internal unique ID (note: not the same as artoolkitX pattern ID)
Definition: ARTrackable.h:86
ARPattern * getPattern(int n)
Returns the specified pattern within this trackable.
Definition: ARTrackable.cpp:115
ARdouble trans[3][4]
Transformation from camera to this trackable. If stereo, transform from left camera to this trackable...
Definition: ARTrackable.h:62
void setFiltered(bool flag)
Definition: ARTrackable.cpp:180
TrackableType type
Type of trackable: single, multi, ...
Definition: ARTrackable.h:87
bool visible
Whether or not the trackable is visible at current time.
Definition: ARTrackable.h:91
virtual bool update(const ARdouble transL2R[3][4]=NULL)
Completes an update begun in the parent class, performing filtering, generating OpenGL view matrix an...
Definition: ARTrackable.cpp:133
ARdouble positionScalefactor()
Definition: ARTrackable.cpp:128
ARPattern ** patterns
Array of pointers to patterns.
Definition: ARTrackable.h:98
ARTrackable & operator=(const ARTrackable &)=delete
Copy assignment is undefined.
ARdouble transformationMatrixR[16]
Transformation suitable for use in OpenGL.
Definition: ARTrackable.h:95
bool isFiltered()
Definition: ARTrackable.cpp:190
ARdouble m_positionScaleFactor
Definition: ARTrackable.h:74
int patternCount
If this trackable has a surface appearance, the number of patterns that it has (1 for single).
Definition: ARTrackable.h:97
void allocatePatterns(int count)
Allocates space for patterns within this trackable.
Definition: ARTrackable.cpp:83
ARdouble transformationMatrix[16]
Transformation suitable for use in OpenGL.
Definition: ARTrackable.h:94
ARdouble filterSampleRate()
Definition: ARTrackable.cpp:195
void setPositionScalefactor(ARdouble scale)
Definition: ARTrackable.cpp:123
void freePatterns()
Frees allocated patterns and resets the pattern count to zero.
Definition: ARTrackable.cpp:97
ARTrackable(const ARTrackable &)=delete
Copy construction is undefined.
ARdouble filterCutoffFrequency()
Definition: ARTrackable.cpp:206
void setFilterCutoffFrequency(ARdouble freq)
Definition: ARTrackable.cpp:211
bool visiblePrev
Whether or not the trackable was visible prior to last update.
Definition: ARTrackable.h:90
virtual ~ARTrackable()
Definition: ARTrackable.cpp:76
TrackableType
Definition: ARTrackable.h:78
@ TwoD
A 2D textured marker backed by an image.
Definition: ARTrackable.h:82
@ SINGLE
A standard single square marker.
Definition: ARTrackable.h:79
@ NFT
A rectangular textured marker backed by an NFT data set.
Definition: ARTrackable.h:81
@ MULTI
A composite marker made up of multiple square markers.
Definition: ARTrackable.h:80
@ MULTI_AUTO
An automatically mapped composite marker made up of multiple square matrix (2D barcode) markers.
Definition: ARTrackable.h:83
Definition: arFilterTransMat.c:41