Source Code Cross Referenced for Marker.java in  » Graphic-Library » apollo » org » apollo » datamodel » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Graphic Library » apollo » org.apollo.datamodel 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Apollo - Motion capture and animation system
003:         * Copyright (c) 2005 Apollo
004:         * 
005:         * This program is free software; you can redistribute it and/or
006:         * modify it under the terms of the GNU General Public License
007:         * as published by the Free Software Foundation; either version 2
008:         * of the License, or (at your option) any later version.
009:         * 
010:         * This program is distributed in the hope that it will be useful,
011:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
012:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
013:         * GNU General Public License for more details.
014:         * 
015:         * You should have received a copy of the GNU General Public License
016:         * along with this program; if not, write to the Free Software
017:         * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
018:         *
019:         * http://www.gnu.org/copyleft/gpl.html
020:         *
021:         * @author Giovane.Kuhn - brain@netuno.com.br
022:         *
023:         */
024:        package org.apollo.datamodel;
025:
026:        import java.awt.Color;
027:        import java.awt.geom.Point2D;
028:        import java.io.Serializable;
029:
030:        import javax.vecmath.Vector2d;
031:        import javax.vecmath.Vector3d;
032:
033:        /**
034:         * Class represent a marker in a video frame
035:         * @author Giovane.Kuhn on 23/05/2005
036:         */
037:        public final class Marker implements  Serializable {
038:
039:            private static final long serialVersionUID = 1L;
040:
041:            /** Marker origin from effect video */
042:            public static final int ORIGIN_EFFECT = 1;
043:
044:            /** Marker origin from user intervention */
045:            public static final int ORIGIN_USER = 2;
046:
047:            /** Marker origin from tracking */
048:            public static final int ORIGIN_TRACKING = 3;
049:
050:            /** Marker number */
051:            private int number;
052:
053:            /** Global X coordinate */
054:            private Double globalX;
055:
056:            /** Global Y coordinate */
057:            private Double globalY;
058:
059:            /** Marker color */
060:            private Color color;
061:
062:            /** Marker in previous frame */
063:            private Marker previous;
064:
065:            /** Marker in next frame */
066:            private Marker next;
067:
068:            /** Marker origin, see ORIGIN_XXX */
069:            private int origin;
070:
071:            /** Joint that this mark tracks */
072:            private TrackingJoint trackingJoint;
073:
074:            public TrackingJoint getTrackingJoint() {
075:                return trackingJoint;
076:            }
077:
078:            public void setTrackingJoint(TrackingJoint joint) {
079:                if (this .trackingJoint == joint) {
080:                    return;
081:                }
082:                if (this .trackingJoint != null) {
083:                    this .trackingJoint.removeMarker(this );
084:                }
085:                this .trackingJoint = joint;
086:                if (joint != null) {
087:                    joint.addMarker(this );
088:                }
089:            }
090:
091:            public int getOrigin() {
092:                return origin;
093:            }
094:
095:            public void setOrigin(int origin) {
096:                this .origin = origin;
097:            }
098:
099:            public Marker getNext() {
100:                return next;
101:            }
102:
103:            public void setNext(Marker next) {
104:                if (this .next == next) {
105:                    return;
106:                }
107:                Marker last = this .next;
108:                this .next = next;
109:                if (last != null) {
110:                    last.setPrevious(null);
111:                }
112:                if (next != null) {
113:                    next.setPrevious(this );
114:                }
115:            }
116:
117:            public Marker getPrevious() {
118:                return previous;
119:            }
120:
121:            public void setPrevious(Marker previous) {
122:                if (this .previous == previous) {
123:                    return;
124:                }
125:                Marker last = this .previous;
126:                this .previous = previous;
127:                if (last != null) {
128:                    last.setNext(null);
129:                }
130:                if (previous != null) {
131:                    previous.setNext(this );
132:                }
133:            }
134:
135:            public Color getColor() {
136:                return color;
137:            }
138:
139:            public void setColor(Color color) {
140:                this .color = color;
141:            }
142:
143:            public int getNumber() {
144:                return number;
145:            }
146:
147:            public void setNumber(int number) {
148:                this .number = number;
149:            }
150:
151:            public Double getGlobalX() {
152:                return globalX;
153:            }
154:
155:            public void setGlobalX(Double x) {
156:                this .globalX = x;
157:            }
158:
159:            public Double getGlobalY() {
160:                return globalY;
161:            }
162:
163:            public void setGlobalY(Double y) {
164:                this .globalY = y;
165:            }
166:
167:            public Double[] getCoordinates3d() {
168:                return new Double[] { globalX, globalY, null };
169:            }
170:
171:            public Vector3d getVector3d() {
172:                return new Vector3d( //
173:                        globalX == null ? Double.NaN : globalX, //
174:                        globalY == null ? Double.NaN : globalY, //
175:                        Double.NaN //
176:                );
177:            }
178:
179:            public Vector2d getVector2d() {
180:                return new Vector2d( //
181:                        globalX == null ? Double.NaN : globalX, //
182:                        globalY == null ? Double.NaN : globalY //
183:                );
184:            }
185:
186:            public void setVector2d(Vector2d vector) {
187:                this .globalX = Double.isNaN(vector.x) ? null : vector.x;
188:                this .globalY = Double.isNaN(vector.y) ? null : vector.y;
189:            }
190:
191:            public void reset() {
192:                setColor(null);
193:                setPrevious(null);
194:                setNext(null);
195:                setTrackingJoint(null);
196:            }
197:
198:            public double distance(Marker other) {
199:                return Point2D.distance(this.getGlobalX(), this.getGlobalY(),
200:                        other.getGlobalX(), other.getGlobalY());
201:            }
202:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.