annotate native/Falcon/utils.h @ 8:ea7885bd9bff tip

fixed bug : render solid line as dotted/dashed when moving the stylus from dotted/dashed to solid
author ccmi-guest
date Thu, 03 Jul 2014 16:12:20 +0100
parents d66dd5880081
children
rev   line source
fiore@5 1 /*
fiore@5 2 CCmI Editor - A Collaborative Cross-Modal Diagram Editing Tool
fiore@5 3
fiore@5 4 Copyright (C) 2011 Queen Mary University of London (http://ccmi.eecs.qmul.ac.uk/)
fiore@5 5
fiore@5 6 This program is free software: you can redistribute it and/or modify
fiore@5 7 it under the terms of the GNU General Public License as published by
fiore@5 8 the Free Software Foundation, either version 3 of the License, or
fiore@5 9 (at your option) any later version.
fiore@5 10
fiore@5 11 This program is distributed in the hope that it will be useful,
fiore@5 12 but WITHOUT ANY WARRANTY; without even the implied warranty of
fiore@5 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
fiore@5 14 GNU General Public License for more details.
fiore@5 15
fiore@5 16 You should have received a copy of the GNU General Public License
fiore@5 17 along with this program. If not, see <http://www.gnu.org/licenses/>.
fiore@5 18 */
fiore@5 19
fiore@5 20 #pragma once
fiore@5 21
fiore@5 22 #include <jni.h>
fiore@5 23 #include <iostream>
fiore@5 24 #include <H3DUtil/Vec3d.h>
fiore@5 25 #include <math.h>
fiore@5 26
fiore@5 27 /* check for Java exception */
fiore@5 28 void checkExceptions(JNIEnv *env, char* what);
fiore@5 29
fiore@5 30 /* exit the program printing a message on the sttandard error */
fiore@5 31 void stopExecution(char* msg);
fiore@5 32
fiore@5 33 /* transforms the coordinates of aPoint from the screen space (the system used in the graphic diagram) *
fiore@5 34 * to the haptic space which is used by the Falcon and goes from about -0.05 to 0.05 on each axis */
fiore@5 35 H3DUtil::ArithmeticTypes::Vec3d & screenToHapticSpace(H3DUtil::ArithmeticTypes::Vec3d & aPoint, int w, int h);
fiore@5 36
fiore@5 37 /* does the inverse of screenToHapticSpace */
fiore@5 38 H3DUtil::ArithmeticTypes::Vec3d & hapticToScreenSpace(H3DUtil::ArithmeticTypes::Vec3d & aPoint, int w, int h);
fiore@5 39
fiore@5 40 /* Calculates the distance between points on a plane whose normal is the Z-axis. This *
fiore@5 41 * means that the z coordinate in not taken into account for the distance calculation */
fiore@5 42 double pointsDistance(const H3DUtil::ArithmeticTypes::Vec3d & p, const H3DUtil::ArithmeticTypes::Vec3d & q);
fiore@5 43
fiore@5 44 /* find the midpoint of a segment foing from start to end. The z coordinate of start and end is not taken into account */
fiore@5 45 H3DUtil::ArithmeticTypes::Vec3d midPoint(const H3DUtil::ArithmeticTypes::Vec3d & start, const H3DUtil::ArithmeticTypes::Vec3d & end);