fiore@5: /* fiore@5: CCmI Editor - A Collaborative Cross-Modal Diagram Editing Tool fiore@5: fiore@5: Copyright (C) 2011 Queen Mary University of London (http://ccmi.eecs.qmul.ac.uk/) fiore@5: fiore@5: This program is free software: you can redistribute it and/or modify fiore@5: it under the terms of the GNU General Public License as published by fiore@5: the Free Software Foundation, either version 3 of the License, or fiore@5: (at your option) any later version. fiore@5: fiore@5: This program is distributed in the hope that it will be useful, fiore@5: but WITHOUT ANY WARRANTY; without even the implied warranty of fiore@5: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the fiore@5: GNU General Public License for more details. fiore@5: fiore@5: You should have received a copy of the GNU General Public License fiore@5: along with this program. If not, see . fiore@5: */ fiore@5: fiore@5: #pragma once fiore@5: fiore@5: #include fiore@5: #include fiore@5: #include fiore@5: #include fiore@5: fiore@5: /* check for Java exception */ fiore@5: void checkExceptions(JNIEnv *env, char* what); fiore@5: fiore@5: /* exit the program printing a message on the sttandard error */ fiore@5: void stopExecution(char* msg); fiore@5: fiore@5: /* transforms the coordinates of aPoint from the screen space (the system used in the graphic diagram) * fiore@5: * to the haptic space which is used by the Falcon and goes from about -0.05 to 0.05 on each axis */ fiore@5: H3DUtil::ArithmeticTypes::Vec3d & screenToHapticSpace(H3DUtil::ArithmeticTypes::Vec3d & aPoint, int w, int h); fiore@5: fiore@5: /* does the inverse of screenToHapticSpace */ fiore@5: H3DUtil::ArithmeticTypes::Vec3d & hapticToScreenSpace(H3DUtil::ArithmeticTypes::Vec3d & aPoint, int w, int h); fiore@5: fiore@5: /* Calculates the distance between points on a plane whose normal is the Z-axis. This * fiore@5: * means that the z coordinate in not taken into account for the distance calculation */ fiore@5: double pointsDistance(const H3DUtil::ArithmeticTypes::Vec3d & p, const H3DUtil::ArithmeticTypes::Vec3d & q); fiore@5: fiore@5: /* 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: H3DUtil::ArithmeticTypes::Vec3d midPoint(const H3DUtil::ArithmeticTypes::Vec3d & start, const H3DUtil::ArithmeticTypes::Vec3d & end);