Go to the documentation of this file.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
00026
00027 #pragma once
00028 #ifndef TestingSphere_H_included
00029 #define TestingSphere_H_included
00030
00031 #include "testing_object_base.h"
00032
00033 namespace srs_env_model
00034 {
00038 class CTestingSphere : public CTestingObjectBase
00039 {
00040 public:
00042 CTestingSphere() : m_radiussq( 0.0 ), m_x( 0.0 ), m_y(0.0), m_z(0.0) {}
00043
00045 CTestingSphere( double x, double y, double z, double radius )
00046 : m_radiussq( radius * radius ), m_x( x ), m_y( y ), m_z( z )
00047 {}
00048
00050 void set( double x, double y, double z, double radius )
00051 { m_radiussq = radius*radius; m_x = x; m_y = y; m_z = z; }
00052
00054 virtual bool isIn( double x, double y, double z )
00055 {
00056 double sx( x - m_x ), sy( y - m_y ), sz( z - m_z );
00057 return sx*sx + sy*sy + sz*sz < m_radiussq;
00058 }
00059
00060 protected:
00062 double m_radiussq;
00063
00065 double m_x, m_y, m_z;
00066
00067 };
00068
00069 }
00070
00071
00072
00073 #endif
srs_env_model
Author(s): Vit Stancl (stancl@fit.vutbr.cz), Tomas Lokaj, Jan Gorig, Michal Spanel (spanel@fit.vutbr.cz)
autogenerated on Sun Jan 5 2014 11:50:50