INTRODUCTION Overview Download and Install Quick Start Documentation Publications NONFRAMEWORK CODE Driver Interfaces Drivers Libraries Utilities FRAMEWORK CODE Interfaces Components Libraries Utilities Full Software Listings DEVELOPER Tutorials Examples Dev Guide Dashboard PEOPLE Contributors Users Project Download Mailing lists
|
libs/orcaquml/model.h00001 /* 00002 * Orca-Robotics Project: Components for robotics 00003 * http://orca-robotics.sf.net/ 00004 * Copyright (c) 2004-2009 Alex Brooks, Alexei Makarenko, Tobias Kaupp 00005 * 00006 * This copy of Orca is licensed to you under the terms described in 00007 * the LICENSE file included in this distribution. 00008 * 00009 */ 00010 00011 #ifndef ORCAQUML_MODEL_H 00012 #define ORCAQUML_MODEL_H 00013 00014 #include <vector> 00015 #include <string> 00016 #include <orcadef/componentdefinition.h> 00017 00018 // Different derived QGraphicsItem's are identified by user defined types 00019 #define RTTI_PROVIDED_INTERFACE 6666 00020 #define RTTI_REQUIRED_INTERFACE 6667 00021 00022 namespace orcaquml 00023 { 00024 00025 struct InterfaceGeom 00026 { 00027 double x; 00028 double y; 00029 }; 00030 00032 struct ComponentGeom 00033 { 00034 int id; 00035 double left; 00036 double top; 00037 bool isHighlighted; 00038 std::vector<InterfaceGeom> provided; 00039 std::vector<InterfaceGeom> required; 00040 }; 00041 00043 class ComponentModel 00044 { 00045 public: 00046 00047 ComponentModel( const orcadef::ComponentDef &def, 00048 const orcadef::ComponentCfg &cfg, 00049 const ComponentGeom &geom ); 00050 ComponentModel( const orcadef::ComponentDef &def, 00051 const orcadef::ComponentCfg &cfg ); 00052 ComponentModel( const orcadef::ComponentDef &def ); 00053 00054 orcadef::ComponentDef def; 00055 orcadef::ComponentCfg cfg; 00056 ComponentGeom geom; 00057 00058 private: 00059 void allocateGeomSpace(); 00060 }; 00061 00066 typedef std::vector<ComponentModel*> SystemModel; 00067 00068 const std::string toString( const SystemModel & ); 00069 const std::string toString( const ComponentModel & ); 00070 const std::string toString( const ComponentGeom & ); 00071 const std::string toString( const InterfaceGeom & ); 00072 00073 } 00074 00075 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)