Skip to Content.
Sympa Menu

cgal-discuss - RE: [cgal-discuss] [HELP] about some advice related to the usage of

Subject: CGAL users discussion list

List archive

RE: [cgal-discuss] [HELP] about some advice related to the usage of


Chronological Thread 
  • From: Kwok Jasper <>
  • To: <>
  • Subject: RE: [cgal-discuss] [HELP] about some advice related to the usage of
  • Date: Tue, 10 Feb 2009 12:50:59 +0800
  • Importance: Normal

Excuse me, for the previous problem that I got..
I really do not know what is the reason for that..

May I ask if if it is that I uses the point() function incorrectly??
i.e. for the derived class below, is it I should not have the get_point() function in that way?

Is it the exception is related to that?
Thanks


template < class GT, class Vb = CGAL::Triangulation_vertex_base_3<GT> >
class Vertex_base_for_ssr
  : public Vb
{
public:
  typedef typename Vb::Vertex_handle  Vertex_handle;
  typedef typename Vb::Cell_handle    Cell_handle;
  typedef typename Vb::Point          Point;

  template < class TDS2 >
  struct Rebind_TDS {
    typedef typename Vb::template Rebind_TDS<TDS2>::Other  Vb2;
    typedef Vertex_base_for_ssr<GT, Vb2>                        Other;
  };


  Vector surface_normal;
  vector<Vertex_handl e> neighbor_vertex_handle;
  double fifth_nearest_dist;


  Vertex_base_for_ssr() {}

  Vertex_base_for_ssr(const Point& p)
    : Vb(p) {}

  Vertex_base_for_ssr(const Point& p, Cell_handle c)
    : Vb(p, c) {}

  void set_surface_normal(double x_i, double y_i, double z_i)
  {
      surface_normal = Vector(x_i, y_i, z_i);
  }

  Point get_point()
  {
      return Vb::point();
  }
};





From:
To:
Date: Mon, 9 Feb 2009 11:04:56 +0800
Subject: RE: [cgal-discuss] [HELP] about some advice related to the usage of

Excuse me, may anybody tell me for the previous code that I posted, is it in some situation using std::list will cause some problem such that the exception occur?

I have spent a few days on that...
but I really don't know what I can do..
I am already using the exact predicate for the triangulation I used in the program.
It is strange that the exception happen at different point of execution each time the program is run...

May I ask if any body has experienced something similar before?
May I ask if any body is willing to tell me what is the possible reason for the exception to happen?




From:
To:
Date: Sun, 8 Feb 2009 17:01:20 +0800
Subject: RE: [cgal-discuss] [HELP] about some advice related to the usage of

Excuse me, after some further investigation, I found that I get the exception when I insert a Point object into  a list
(i.e.) the 2 lines of code below 

            co_input.push_back(Point(tempX2 - tempX1 , tempY2 - tempY1, tempZ2 - tempZ1));
            co_input.push_back(p);

inside the following code.


    Point_3 * co_mean = NULL;
    list<Point> co_input;
    list<Point>::iterator co_itr;


vector<Vertex_handle>::iterator nv_itr;

    double temp_fifth_nearest_dist;
    double tempX1;
    double tempY1;
    double tempZ1;
    double tempX2;
    double tempY2;
    double tempZ2;
    double dist;


    for(curr = start; curr != end; ++curr)
    {
        if (co_mean != NULL)
        {
           delete co_mean;
           co_mea n = NULL;
        }

        if (co_input.size() != 0)
        {
           co_input.clear();
        }

        x_total = 0;
        y_total = 0;
        z_total = 0;

        x_variance = 0;
        y_variance = 0;
        z_variance = 0;
 
        x_y_covariance = 0;
        y_z_covariance = 0;
        x_z_covariance = 0;
        temp_fifth_nearest_dist = curr -> fifth_nearest_dist;

     &a mp;n bsp;  cout << temp_fifth_nearest_dist << endl;



        nv_itr = (curr -> neighbor_vertex_handle).begin();


        while(1)
        {

            if (nv_itr == (curr -> neighbor_vertex_handle).end())
            {
               break;
            }
       
            tempX1 = (curr -> point()).x();
            tempY1 = (curr -> point()).y();
            tempZ1 = (curr -> point()).z();

         &am p;nb sp;  cout << "b0" << endl;

            tempX2 = ((*nv_itr) -> get_point()).x();
            tempY2 = ((*nv_itr) -> get_point()).y();
            tempZ2 = ((*nv_itr) -> get_point()).z();
           

            cout << "b1" << endl;

            dist = pow((tempX1 - tempX2),2);
          
            dist += pow((tempY1 - tempY2),2);
            dist += pow((tempZ1 - tempZ2),2);
            dist = sqrt(dist);
           
            co_input.push_back(Point(tempX2 - tempX1 , tempY2 - tempY1, tempZ2 - tempZ1));
            co_input.push_back(p);

           
            ++nv_itr; 
   }


May I ask if is possible the problem actually relates to the use of

    list<Point> co_input;
    list<Point>::iterator co_itr;

i.e. the std::list object with the Point object in CGAL?
And even I change the std::list into std::vector, the same exception still exist..


Thank you


           
         

From:
To:
Date: Sun, 8 Feb 2009 16:06:38 +0800
Subject: RE: [cgal-discuss] [HELP] about some advice related to the usage of

Thanks.

Actually, I used the following to declare the triangulation

typedef CGAL::Exact_predicates_inexact_constructions_kernel K;


typedef CGAL::Triangulation_data_structure_3<Vertex_base_for_ssr<K> > Tds;
typedef CGAL::Delaunay_triangulation_3<K, Tds> Delaunay_triangulation;

typedef Delaunay_triangulation::Vertex_handle Vertex_handle;
typedef Delaunay_triangulation::Point Point;
typedef Delaunay_triangulation::Finite_vertices_iterator
Finite_vertices_iterator;
typedef Delaunay_triangulation::Finite_facets_iterator
Finite_facets_iterator;

typedef Delaunay_triangulation::Triangle Triangle;
typedef Delaunay_triangulation::Segment Segment;


I am using the exact kernel.

Is it possibly, I need to reinstall CGAL to solve the problem?
Or is there still any other possible reason for the probelm to occur?

Thank you very much
From: laurent.rineau__
To:
Date: Sat, 7 Feb 2009 18:33:53 +0100
Subject: Re: [cgal-discuss] [HELP] about some advice related to the usage of

On Saturday 07 February 2009 17:58:49 Kwok Jasper wrote:
> Excuse me, for the code in the question that I have asked before,
>
>
>
> may I ask if I have understood the CGAL manual properly an used the
> structure and function there correctly.
>
> Although the my whole code can be compiled, it get exception


Perhaps you do not use an filtered or exa
ct kernel
.



--
Laurent Rineau, PhD
Engineer at GeometryFactory
http://www.geometryfactory.com/


Windows Live Gallery 讓才華綻放,讓全世界看見你的創造。

內在氣質才是致勝之道-您是哪一 最原始的溝通是用心的交流。

內在氣質才是致勝之道-您是哪一 最原始的溝通是用心的交流。

人與人之間的距離只有一指之隔。



Archive powered by MHonArc 2.6.16.

Top of Page