Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

GeoDescriptor.h

Go to the documentation of this file.
00001 #ifndef GeoDescriptorH
00002 #define GeoDescriptorH
00003 
00004 /*******************************************************************************
00005 Copyright 2001,2002 Petr Kulhanek
00006 
00007     This file is part of Core plugin.
00008 
00009     Core plugin is free software; you can redistribute it and/or modify
00010     it under the terms of the GNU General Public License as published by
00011     the Free Software Foundation; either version 2 of the License, or
00012     (at your option) any later version.
00013 
00014     Core plugin is distributed in the hope that it will be useful,
00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017     GNU General Public License for more details.
00018 
00019     You should have received a copy of the GNU General Public License
00020     along with Core plugin; if not, write to the Free Software
00021     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00022 *******************************************************************************/
00023 /*******************************************************************************
00024 ** PROJECT:             Project NEMESIS
00025 ** FILE:                GeoDescriptor
00026 ** FUNCTION:            independent system of geometry measurement
00027 ** VERSION:             2.0
00028 ** LANGUAGE:            CBuilder C++
00029 ** TARGET COMPUTER:     IBM PC
00030 ** PROGRAMMER:          Petr Kulhánek
00031 ** HISTORY:
00032 VERSION DATE        NOTE
00033 2.0     2001-12-29  start from old definition coming from revision 4
00034 *******************************************************************************/
00035 
00039 /* HEADER FILES ***************************************************************/
00040 
00041 #include "CoreMainHeader.h"
00042 #include "Point.h"
00043 #include "SimpleList.h"
00044 
00045 /* HEDER FILES END ************************************************************/
00046 
00047 class CSelection;
00048 class CExtObject;
00049 
00050 /* CLASS DECLARATION ***********************************************************/
00051 
00053 
00056 class NEMESIS_CORE_PACKAGE CGeoMeasurement{
00057  // User data ------------------------------------------------------------------
00058     public:
00059     static double __fastcall GetDistance(CSelection* selection);
00060     static double __fastcall GetAngle(CSelection* selection);
00061     static double __fastcall GetDihedral(CSelection* selection);
00062 
00063     static double __fastcall GetDistance(CSimpleList<CExtObject>& list);
00064     static double __fastcall GetDistance(const CPoint& p1,const CPoint& p2);
00065 
00066     static double __fastcall GetAngle(CSimpleList<CExtObject>& list);
00067     static double __fastcall GetAngle(const CPoint& p1,const CPoint& p2,const CPoint& p3);
00068 
00069     static double __fastcall GetDihedral(CSimpleList<CExtObject>& list);
00070     static double __fastcall GetDihedral(const CPoint& p1,const CPoint& p2,const CPoint& p3,const CPoint& p4);
00071     };
00072 
00073 // -----------------------------------------------------------------------------
00074 
00076 
00079 class NEMESIS_CORE_PACKAGE CGeoDescriptor{
00080     public:
00081     enum EType{
00082             NILL,
00083             ONE_POINT,
00084             TWO_POINT,
00085             TWO_POINT_ORIENTED,
00086             THREE_POINT,
00087             FOUR_POINT,
00088             LINE,
00089             PLANE,
00090             };
00091 
00092     inline __fastcall CGeoDescriptor(void){Type=NILL;};
00093     inline __fastcall CGeoDescriptor(EType type);
00094 
00095  // metody - nastavovací funkce
00096     inline void __fastcall SetType(EType type);
00097     inline void __fastcall SetData(double a,double b,double c,double d);
00098     inline void __fastcall SetPoint1(const CPoint& point);
00099     inline void __fastcall SetPoint2(const CPoint& point);
00100     inline void __fastcall SetPoint3(const CPoint& point);
00101     inline void __fastcall SetPoint4(const CPoint& point);
00102 
00103  // metody - zjištovací funkce
00104     inline EType  __fastcall GetType(void);
00105     inline void __fastcall GetData(double &a,double &b,double &c,double &d);
00106     inline const CPoint& __fastcall GetPoint1(void);
00107     inline const CPoint& __fastcall GetPoint2(void);
00108     inline const CPoint& __fastcall GetPoint3(void);
00109     inline const CPoint& __fastcall GetPoint4(void);
00110 
00111  // Private data ---------------------------------------------------------------
00112     private:
00113     CPoint  Point1;
00114     CPoint  Point2;
00115     CPoint  Point3;
00116     CPoint  Point4;
00117     EType  Type;
00118     };
00119 
00120 /* CLASS DECLARATION END *******************************************************/
00121 
00122 
00123 inline __fastcall CGeoDescriptor::CGeoDescriptor(EType type)
00124 {
00125  Type = type;
00126 }
00127 
00128 //---------------------------------------------------------------------------
00129 
00130 inline void __fastcall CGeoDescriptor::SetType(EType type)
00131 {
00132  Type = type;
00133 }
00134 
00135 inline void __fastcall CGeoDescriptor::SetData(double a,double b,double c,double d)
00136 {
00137  Point1.x = a;
00138  Point1.y = b;
00139  Point1.z = c;
00140  Point2.x = d;
00141 }
00142 
00143 inline void __fastcall CGeoDescriptor::SetPoint1(const CPoint& point)
00144 {
00145  Point1 = point;
00146 }
00147 
00148 inline void __fastcall CGeoDescriptor::SetPoint2(const CPoint& point)
00149 {
00150  Point2 = point;
00151 }
00152 
00153 inline void __fastcall CGeoDescriptor::SetPoint3(const CPoint& point)
00154 {
00155  Point3 = point;
00156 }
00157 
00158 inline void __fastcall CGeoDescriptor::SetPoint4(const CPoint& point)
00159 {
00160  Point4 = point;
00161 }
00162 
00163 //---------------------------------------------------------------------------
00164 
00165 inline CGeoDescriptor::EType  __fastcall CGeoDescriptor::GetType(void)
00166 {
00167  return(Type);
00168 }
00169 
00170 inline void __fastcall CGeoDescriptor::GetData(double &a,double &b,double &c,double &d)
00171 {
00172  a = Point1.x;
00173  b = Point1.y;
00174  c = Point1.z;
00175  d = Point2.x;
00176 }
00177 
00178 inline const CPoint& __fastcall CGeoDescriptor::GetPoint1(void)
00179 {
00180  return(Point1);
00181 }
00182 
00183 inline const CPoint& __fastcall CGeoDescriptor::GetPoint2(void)
00184 {
00185  return(Point2);
00186 }
00187 
00188 inline const CPoint& __fastcall CGeoDescriptor::GetPoint3(void)
00189 {
00190  return(Point3);
00191 }
00192 
00193 inline const CPoint& __fastcall CGeoDescriptor::GetPoint4(void)
00194 {
00195  return(Point4);
00196 }
00197 
00198 //---------------------------------------------------------------------------
00199 #endif

Generated on Sun Feb 9 12:53:50 2003 for NemesisCore by doxygen1.3-rc2