From 2b4e7aad8f43a88389f22f169bb5d502465d405c Mon Sep 17 00:00:00 2001 From: Philippose Rajan Date: Fri, 10 Jul 2009 11:56:45 +0000 Subject: [PATCH] * Face colours added to FaceDescriptor class to allow for geometry independent implementation of face colours * Added functions to set and retrieve face colour data to FaceDescriptor class --- libsrc/meshing/meshtype.cpp | 15 +++++++++++++-- libsrc/meshing/meshtype.hpp | 11 +++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/libsrc/meshing/meshtype.cpp b/libsrc/meshing/meshtype.cpp index 7c95d957..e7dafe0b 100644 --- a/libsrc/meshing/meshtype.cpp +++ b/libsrc/meshing/meshtype.cpp @@ -2260,6 +2260,9 @@ namespace netgen { surfnr = domin = domout = bcprop = 0; domin_singular = domout_singular = 0.; + // Philippose - 06/07/2009 + // Initialise surface colour + surfcolour = Vec3d(0.0,1.0,0.0); tlosurf = -1; bcname = 0; firstelement = -1; @@ -2268,7 +2271,8 @@ namespace netgen FaceDescriptor :: FaceDescriptor(const FaceDescriptor& other) : surfnr(other.surfnr), domin(other.domin), domout(other.domout), tlosurf(other.tlosurf), bcprop(other.bcprop), bcname(other.bcname), - domin_singular(other.domin_singular), domout_singular(other.domout_singular) + domin_singular(other.domin_singular), domout_singular(other.domout_singular), + surfcolour(other.surfcolour) { firstelement = -1; } @@ -2279,6 +2283,9 @@ namespace netgen surfnr = surfnri; domin = domini; domout = domouti; + // Philippose - 06/07/2009 + // Initialise surface colour + surfcolour = Vec3d(0.0,1.0,0.0); tlosurf = tlosurfi; bcprop = surfnri; domin_singular = domout_singular = 0.; @@ -2291,6 +2298,9 @@ namespace netgen surfnr = seg.si; domin = seg.domin+1; domout = seg.domout+1; + // Philippose - 06/07/2009 + // Initialise surface colour + surfcolour = Vec3d(0.0,1.0,0.0); tlosurf = seg.tlosurf+1; bcprop = 0; domin_singular = domout_singular = 0.; @@ -2333,7 +2343,8 @@ namespace netgen << ", tlosurf = " << fd.tlosurf << ", bcprop = " << fd.bcprop << ", domin_sing = " << fd.domin_singular - << ", domout_sing = " << fd.domout_singular; + << ", domout_sing = " << fd.domout_singular + << ", colour = " << fd.surfcolour; return s; } diff --git a/libsrc/meshing/meshtype.hpp b/libsrc/meshing/meshtype.hpp index e950a1df..5561b4ad 100644 --- a/libsrc/meshing/meshtype.hpp +++ b/libsrc/meshing/meshtype.hpp @@ -885,6 +885,11 @@ class FaceDescriptor int tlosurf; /// boundary condition property int bcprop; + // Philippose - 06/07/2009 + // Add capability to store surface colours along with + // other face data + /// surface colour (Default: R=0.0 ; G=1.0 ; B=0.0) + Vec3d surfcolour; /// string * bcname; @@ -909,6 +914,9 @@ public: int DomainOut () const { return domout; } int TLOSurface () const { return tlosurf; } int BCProperty () const { return bcprop; } + // Philippose - 06/07/2009 + // Get Surface colour + Vec3d SurfColour () const { return surfcolour; } string GetBCName () const; // string * BCNamePtr () { return bcname; } // const string * BCNamePtr () const { return bcname; } @@ -917,6 +925,9 @@ public: void SetDomainOut (int dom) { domout = dom; } void SetBCProperty (int bc) { bcprop = bc; } void SetBCName (string * bcn) { bcname = bcn; } + // Philippose - 06/07/2009 + // Set the surface colour + void SetSurfColour (Vec3d colour) { surfcolour = colour; } friend ostream & operator<<(ostream & s, const FaceDescriptor & fd); friend class Mesh;