00001 /*======================================================================= 00002 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), *** 00003 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. *** 00004 *** *** 00005 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS *** 00006 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR *** 00007 *** WRITTEN AUTHORIZATION OF FEI S.A.S. *** 00008 *** *** 00009 *** RESTRICTED RIGHTS LEGEND *** 00010 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS *** 00011 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN *** 00012 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT *** 00013 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN *** 00014 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. *** 00015 *** *** 00016 *** COPYRIGHT (C) 1996-2019 BY FEI S.A.S, *** 00017 *** BORDEAUX, FRANCE *** 00018 *** ALL RIGHTS RESERVED *** 00019 **=======================================================================*/ 00020 /*======================================================================= 00021 ** Author : Martial Papillon (mar 2016) 00022 **=======================================================================*/ 00023 00024 #ifndef _SB_LINE_PROFILE_H_ 00025 #define _SB_LINE_PROFILE_H_ 00026 00027 #include <ImageViz/SoImageViz.h> 00028 #include <Inventor/SbVec.h> 00029 #include <Inventor/SbDataType.h> 00030 #include <ImageViz/Nodes/Images/SoImageDataAdapter.h> 00031 00044 class SbDiscreteLineProfile 00045 { 00046 public: 00048 00056 SbDiscreteLineProfile( SbVec2i32 p1, SbVec2i32 p2, SoImageDataAdapter* image ); 00057 SbDiscreteLineProfile( SbVec3i32 p1, SbVec3i32 p2, SoImageDataAdapter* image ); 00058 SbDiscreteLineProfile( SbVec4i32 p1, SbVec4i32 p2, SoImageDataAdapter* image ); 00059 // @} 00060 00064 ~SbDiscreteLineProfile(); 00065 00069 size_t getLength() const; 00070 00080 const double& getValue( int index, int component = 0 ) const; 00081 00086 const double* getValues() const; 00087 00094 const SbVec4i32& getPosition( int index ) const; 00095 00099 const SbVec4i32& getFirstPosition() const; 00100 00104 const SbVec4i32& getLastPosition() const; 00105 00117 const double& operator[]( int i ) const ; 00118 00119 private: 00120 // Internal method to extract the line profile 00121 void init( SbVec4i32 p1, SbVec4i32 p2, SoImageDataAdapter* image ); 00123 std::vector<double> m_values; 00124 std::vector<SbVec4i32> m_positions; 00125 int m_nbComponents; 00126 }; 00127 00128 #endif