Advertisement
TheWhiteFang

DLLGeo Header files

Jan 16th, 2015
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.19 KB | None | 0 0
  1. //This are the DLLGeo Header files
  2. //CubeGeometricCalc.h
  3. #ifndef __CUBEGEOMETRICCALC_H__
  4. #define __CUBEGEOMETRICCALC_H__
  5.  
  6. #include "IGeometricCalc.h"
  7.  
  8. class CubeGeometricCalc :public IGeometricCalc {
  9. private:
  10.     float m_Side;
  11.     float m_Height;
  12.     float m_Radius;
  13.     float m_SurfaceArea;
  14.     float m_Volume;
  15.  
  16. public:
  17.     void SetGeometricAttributes(float inSide1, float inSide2, float inRadius);
  18.     float CalculateSurfaceArea();
  19.     float CalculateVolume();
  20. };
  21.  
  22. #endif
  23. ------------------------------------------------
  24. //CylinderGeometricCalc.h
  25. #ifndef __CYLINDERGEOMETRICCALC_H__
  26. #define __CYLINDERGEOMETRICCALC_H__
  27.  
  28. #include "IGeometricCalc.h"
  29.  
  30. class CylinderGeometricCalc :public IGeometricCalc {
  31. private:
  32.     float m_Side;
  33.     float m_Height;
  34.     float m_Radius;
  35.     float m_SurfaceArea;
  36.     float m_Volume;
  37.  
  38. public:
  39.     void SetGeometricAttributes(float inSide1, float inSide2, float inRadius);
  40.     float CalculateSurfaceArea();
  41.     float CalculateVolume();
  42.  
  43. };
  44.  
  45. #endif
  46. ------------------------------------------
  47. //DLLGeo.h
  48. #ifndef __DLLTEST_H__
  49. #define __DLLTEST_H__
  50.  
  51. #ifdef DLL_EXPORT
  52. #define DLLTEST_API __declspec (dllexport)
  53. #else
  54. #define DLLTEST_API __declspec (dllimport)
  55. #endif
  56.  
  57. #include "IGeometricCalc.h"
  58.  
  59.  
  60. extern "C"
  61. {
  62.     DLLTEST_API IGeometricCalc* NewObject(int operation);
  63.     DLLTEST_API void DelObject(IGeometricCalc *pObject);
  64. }
  65.  
  66. #endif
  67. ---------------------------------
  68. //IGeometricCalc.h
  69. #ifndef __IGEOMETRICCALC_H__
  70. #define __IGEOMETRICCALC_H__
  71.  
  72. #define PI 3.142
  73.  
  74. class IGeometricCalc
  75. {
  76. public:
  77.     virtual void SetGeometricAttributes(float inSide1, float inSide2, float inRadius) = 0;
  78.  
  79.     virtual float CalculateSurfaceArea() = 0;
  80.     virtual float CalculateVolume() = 0;
  81.  
  82. };
  83. #endif
  84. ---------------------------------------
  85. //SphereGeometricCalc.h
  86. #ifndef __SPHEREGEOMETRICCALC_H__
  87. #define __SPHEREGEOMETRICCALC_H__
  88.  
  89. #include "IGeometricCalc.h"
  90. #define PI 3.142
  91.  
  92. class SphereGeometricCalc : public IGeometricCalc
  93. {
  94. private:
  95.     float m_Side;
  96.     float m_Height;
  97.     float m_Radius;
  98.     float m_SurfaceArea;
  99.     float m_Volume;
  100.  
  101. public:
  102.     void SetGeometricAttributes(float inSide1, float inSide2, float inRadius);
  103.     float CalculateSurfaceArea();
  104.     float CalculateVolume();
  105.  
  106. };
  107.  
  108. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement