Contents
- Using standard containers of OpenCASCADE from the TCol… package
- Quick concept of handles
- Matrix operations using math_Matrix
Introduction
This example will introduce two basic elements from OpenCASCADE: standard collections and handles. As for standard collections, they very much resemble the containers of the standard library of C++ (like vectors or lists), but they come as built in types of OpenCASCADE. Similarly, handles are pretty much equivalent to shared_ptr-s of boost or the C++11 standard – they incorporate reference counting and automatic destruction, for example. Our working example today is going to be a classic geometric exercise – calculating the area of a polygonized circle. The main classes we will talk about are:
- TColgp_Array1OfPnt for storing a set of points
- TColgp_HArray1OfPnt a flavour of the above, allows for passing around smart pointers to arrays (or passing around handles)
- math_Matrix, class that allows for storing and operating on matrices