Colors.h

Go to the documentation of this file.
00001 /******************************************************************************
00002 *       SOFA, Simulation Open-Framework Architecture, version 1.0 beta 3      *
00003 *                (c) 2006-2008 MGH, INRIA, USTL, UJF, CNRS                    *
00004 *                                                                             *
00005 * This library is free software; you can redistribute it and/or modify it     *
00006 * under the terms of the GNU Lesser General Public License as published by    *
00007 * the Free Software Foundation; either version 2.1 of the License, or (at     *
00008 * your option) any later version.                                             *
00009 *                                                                             *
00010 * This library is distributed in the hope that it will be useful, but WITHOUT *
00011 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or       *
00012 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
00013 * for more details.                                                           *
00014 *                                                                             *
00015 * You should have received a copy of the GNU Lesser General Public License    *
00016 * along with this library; if not, write to the Free Software Foundation,     *
00017 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA.          *
00018 *******************************************************************************
00019 *                               SOFA :: Modules                               *
00020 *                                                                             *
00021 * Authors: The SOFA Team and external contributors (see Authors.txt)          *
00022 *                                                                             *
00023 * Contact information: contact@sofa-framework.org                             *
00024 ******************************************************************************/
00025 #ifndef SOFA_SIMULATION_COLORS_H
00026 #define SOFA_SIMULATION_COLORS_H
00027 
00028 #include <stdlib.h>
00029 #include <string.h>
00030 
00031 namespace sofa
00032 {
00033 
00034 namespace simulation
00035 {
00036 
00037 
00038 namespace Colors
00039 {
00040 
00041 enum {
00042     NODE = 0,
00043     OBJECT = 1,
00044     CONTEXT = 2,
00045     BMODEL = 3,
00046     CMODEL = 4,
00047     MMODEL = 5,
00048     CONSTRAINT = 6,
00049     IFFIELD = 7,
00050     FFIELD = 8,
00051     SOLVER = 9,
00052     COLLISION = 10,
00053     MMAPPING = 11,
00054     MAPPING = 12,
00055     MASS = 13,
00056     TOPOLOGY = 14,
00057     VMODEL = 15,
00058 };
00059 
00060 // See http://www.graphviz.org/doc/info/colors.html
00061 // The following is mostly the "set312" colors
00062 
00063 static const char* COLOR[16]={
00064     /*Node                  =*/ "#dedede", // color 9
00065     /*Object                =*/ "#ffffff", // white
00066     /*Context               =*/ "#d7191c", // color spectral4/1
00067     /*BehaviorModel         =*/ "#93ff49", // color 7 (brighter)
00068     /*CollisionModel        =*/ "#fccde5", // color 8
00069     /*MechanicalState       =*/ "#8dd3c7", // color 1
00070     /*Constraint            =*/ "#fdb462", // color 6
00071     /*InteractionForceField =*/ "#fb8072", // color 4
00072     /*ForceField            =*/ "#bebada", // color 3
00073     /*Solver                =*/ "#b3de69", // color 7
00074     /*CollisionPipeline     =*/ "#bc80bd", // color 10
00075     /*MechanicalMapping     =*/ "#2b83da", // color spectral4/4
00076     /*Mapping               =*/ "#80b1d3", // color 5
00077     /*Mass                  =*/ "#ffffb3", // color 2
00078     /*Topology              =*/ "#ffed6f", // color 12
00079     /*VisualModel           =*/ "#eefdea", // color 11 (brighter)
00080 };
00081 
00082 inline const char* getColor(const char* classname)
00083 {
00084     if (!strcmp(classname,"BaseNode")) return COLOR[NODE];
00085     if (!strcmp(classname,"BaseObject")) return COLOR[OBJECT];
00086     if (!strcmp(classname,"ContextObject")) return COLOR[CONTEXT];
00087     if (!strcmp(classname,"BehaviorModel")) return COLOR[BMODEL];
00088     if (!strcmp(classname,"CollisionModel")) return COLOR[CMODEL];
00089     if (!strcmp(classname,"MechanicalState")) return COLOR[MMODEL];
00090     if (!strcmp(classname,"Constraint")) return COLOR[CONSTRAINT];
00091     if (!strcmp(classname,"InteractionForceField")) return COLOR[IFFIELD];
00092     if (!strcmp(classname,"ForceField")) return COLOR[FFIELD];
00093     if (!strcmp(classname,"MasterSolver")) return COLOR[SOLVER];
00094     if (!strcmp(classname,"OdeSolver")) return COLOR[SOLVER];
00095     if (!strcmp(classname,"CollisionPipeline")) return COLOR[COLLISION];
00096     if (!strcmp(classname,"MechanicalMapping")) return COLOR[MMAPPING];
00097     if (!strcmp(classname,"Mapping")) return COLOR[MAPPING];
00098     if (!strcmp(classname,"Mass")) return COLOR[MASS];
00099     if (!strcmp(classname,"Topology")) return COLOR[TOPOLOGY];
00100     if (!strcmp(classname,"VisualModel")) return COLOR[VMODEL];
00101     return "";
00102 
00103 }
00104 
00105 }
00106 
00107 
00108 } // namespace simulation
00109 
00110 } // namespace sofa
00111 
00112 #endif

Generated on Sun Nov 23 04:05:45 2008 for Sofa by  doxygen 1.5.7.1