00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
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
00061
00062
00063 static const char* COLOR[16]={
00064 "#dedede",
00065 "#ffffff",
00066 "#d7191c",
00067 "#93ff49",
00068 "#fccde5",
00069 "#8dd3c7",
00070 "#fdb462",
00071 "#fb8072",
00072 "#bebada",
00073 "#b3de69",
00074 "#bc80bd",
00075 "#2b83da",
00076 "#80b1d3",
00077 "#ffffb3",
00078 "#ffed6f",
00079 "#eefdea",
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 }
00109
00110 }
00111
00112 #endif