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: #include fiore@5: #include fiore@5: #include fiore@5: fiore@5: #include "utils.h" fiore@5: fiore@5: fiore@5: /* this class uses the java haptic object lists to provide nodes * fiore@5: * and edges to draw to the graphic and haptic managers */ fiore@5: class CollectionsManager { fiore@5: public: fiore@5: struct NodeData { fiore@5: jdouble x; fiore@5: jdouble y; fiore@5: jint hapticId; fiore@5: jint diagramId; fiore@5: fiore@5: NodeData(){} fiore@5: private : fiore@5: NodeData(const NodeData& n){/* avoid mistakenly copy construction calls */} fiore@5: }; fiore@5: fiore@5: struct EdgeData{ fiore@5: jdouble *x; fiore@5: jdouble *y; fiore@5: bool **adjMatrix; fiore@5: jint hapticId; fiore@5: jint diagramId; fiore@5: jint stipplePattern; fiore@5: jsize nodeStart; fiore@5: jdouble attractPoint[2]; fiore@5: void setSize(unsigned int s){ fiore@5: size = s; fiore@5: if(s > previousSize){ fiore@5: /* delete the old memory */ fiore@5: delete [] x; fiore@5: delete [] y; fiore@5: for(unsigned int i=0; i