FastUIDraw
painter_attribute_data_filler.hpp
Go to the documentation of this file.
1 /*!
2  * \file painter_attribute_data_filler.hpp
3  * \brief file painter_attribute_data_filler.hpp
4  *
5  * Copyright 2016 by Intel.
6  *
7  * Contact: kevin.rogovin@gmail.com
8  *
9  * This Source Code Form is subject to the
10  * terms of the Mozilla Public License, v. 2.0.
11  * If a copy of the MPL was not distributed with
12  * this file, You can obtain one at
13  * http://mozilla.org/MPL/2.0/.
14  *
15  * \author Kevin Rogovin <kevin.rogovin@gmail.com>
16  *
17  */
18 
19 
20 #ifndef FASTUIDRAW_PAINTER_ATTRIBUTE_DATA_FILLER_HPP
21 #define FASTUIDRAW_PAINTER_ATTRIBUTE_DATA_FILLER_HPP
22 
23 #include <fastuidraw/util/util.hpp>
26 
27 namespace fastuidraw
28 {
29 /*!\addtogroup PainterAttribute
30  * @{
31  */
32 
33  /*!
34  * \brief
35  * A PainterAttributeDataFiller is the interfaceto fill the
36  * data held by a \ref PainterAttributeData
37  */
39  {
40  public:
41  virtual
43  {}
44 
45  /*!
46  * To be implemented by a derived class to specify
47  * how many attributes, indices and chunks the
48  * PainterAttributeDataFiller will fill. All attributes
49  * and indices are on a common array. A chunk is a
50  * selection of attribute and index data. Each
51  * of the outputs is initialized as zero.
52  * \param[out] number_attributes number of total attributes to be set
53  * \param[out] number_indices number of total indices to be set
54  * \param[out] number_attribute_chunks number of attribute chunks to be set
55  * \param[out] number_index_chunks number of index chunks to be set
56  * \param[out] number_z_ranges the number of z-ranges to be set;
57  * z-ranges of PainterAttribtueData are
58  * accessed by PainterAttributeData::z_ranges()
59  * and PainterAttributeData::z_range().
60  */
61  virtual
62  void
63  compute_sizes(unsigned int &number_attributes,
64  unsigned int &number_indices,
65  unsigned int &number_attribute_chunks,
66  unsigned int &number_index_chunks,
67  unsigned int &number_z_ranges) const = 0;
68 
69  /*!
70  * To be implemented by a derived class to fill data.
71  * \param attributes location to which to place attributes
72  * \param indices location to which to place indices
73  * \param attrib_chunks location to which to fill attribute chunks;
74  * each element of attrib_chunks must be a
75  * sub-array of attributes. Initialized so that
76  * each element is an empty array.
77  * \param index_chunks location to which to fill index chunks;
78  * each element of attrib_chunks must be a
79  * sub-array of indices. Initialized so that
80  * each element is an empty array.
81  * \param zranges location to which to fill the z-range values
82  * (PainterAttributeData::z_ranges()).
83  * \param index_adjusts location to which to fill the index adjust value
84  * (PainterAttributeData::index_adjust_chunks()).
85  */
86  virtual
87  void
89  c_array<PainterIndex> indices,
91  c_array<c_array<const PainterIndex> > index_chunks,
92  c_array<range_type<int> > zranges,
93  c_array<int> index_adjusts) const = 0;
94  };
95 /*! @} */
96 }
97 
98 #endif
virtual void compute_sizes(unsigned int &number_attributes, unsigned int &number_indices, unsigned int &number_attribute_chunks, unsigned int &number_index_chunks, unsigned int &number_z_ranges) const =0
all classes and functions of FastUIDraw are in the namespace fastuidraw.
Definition: colorstop.hpp:28
virtual void fill_data(c_array< PainterAttribute > attributes, c_array< PainterIndex > indices, c_array< c_array< const PainterAttribute > > attrib_chunks, c_array< c_array< const PainterIndex > > index_chunks, c_array< range_type< int > > zranges, c_array< int > index_adjusts) const =0
A PainterAttributeDataFiller is the interfaceto fill the data held by a PainterAttributeData.
file c_array.hpp
file util.hpp
A c_array is a wrapper over a C pointer with a size parameter to facilitate bounds checking and provi...
Definition: c_array.hpp:43
file painter_attribute.hpp
Class for which copy ctor and assignment operator are private functions.
Definition: util.hpp:505