<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2016-08-10 14:32 GMT+02:00 Elvis Stansvik <span dir="ltr"><<a href="mailto:elvis.stansvik@orexplore.com" target="_blank">elvis.stansvik@orexplore.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div><div><div>Hi,<br><br></div>The overview at<br><br>    <a href="https://blog.kitware.com/a-tour-of-vtk-pointer-classes/" target="_blank">https://blog.kitware.com/a-<wbr>tour-of-vtk-pointer-classes/</a><br><br></div>seems to suggest that forward declaration of a class Foo should be enough to be able to declare a vtkNew<Foo> (e.g. see how vtkTable is used in the code example under "Use of Classes").<br><br></div>But when I try e.g:<br><br>class vtkCompositeTransferFunctionIt<wbr>em;<br>...<br>vtkNew<<wbr>vtkCompositeTransferFunctionIt<wbr>em> m_functionsItem;<br><br></div>I get<br><br>    error: invalid use of incomplete type ‘class vtkCompositeTransferFunctionIt<wbr>em’<br><br></div><div>Do I really need to include vtkCompositeTransferFunctionIt<wbr>em.h to declare a vtkNew<<wbr>vtkCompositeTransferFunctionIt<wbr>em> ?<br></div></div></blockquote><div><br></div><div>To show more of the context where I'm trying this:<br><br>#pragma once<br><br>#include "VTKWidget.h"<br><br>#include <QObject><br>#include <Qt><br><br>#include <vtkNew.h><br><br>#include <vtkChartXY.h><br>#include <vtkContextView.h><br>#include <vtkCompositeControlPointsItem.h><br>#include <vtkCompositeTransferFunctionItem.h><br><br>class QWidget;<br><br>class vtkColorTransferFunction;<br>// Apparently I can't just forward declare these.<br>//class vtkChartXY;<br>//class vtkCompositeTransferFunctionItem;<br>//class vtkCompositeControlPointsItem;<br>//class vtkContextView;<br>class vtkPiecewiseFunction;<br><br>class CompositeTransferFunctionEditor : public VTKWidget<br>{<br>    Q_OBJECT<br><br>public:<br>    enum Mode {<br>        EditColor,<br>        EditOpacity<br>    };<br>    Q_ENUM(Mode)<br><br>public:<br>    CompositeTransferFunctionEditor(vtkColorTransferFunction *colorFunction,<br>                                    vtkPiecewiseFunction *opacityFunction,<br>                                    Mode mode = EditColor,<br>                                    QWidget *parent = 0,<br>                                    Qt::WindowFlags flags = Qt::WindowFlags());<br><br>    void setColorFunction(vtkColorTransferFunction *colorFunction);<br>    void setOpacityFunction(vtkPiecewiseFunction *opacityFunction);<br><br>signals:<br>    void functionsModified();<br><br>private:<br>    void editColorPoint();<br><br>private:<br>    vtkNew<vtkCompositeTransferFunctionItem> m_functionsItem;<br>    vtkNew<vtkCompositeControlPointsItem> m_pointsItem;<br>    vtkNew<vtkChartXY> m_chart;<br>    vtkNew<vtkContextView> m_contextView;<br>};<br><br></div><div>I had hoped I would only have to forward declare the types used in the instantiations of vtkNew here, not include the full headers.<br><br></div><div>Elvis<br><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><br></div><div>Thanks,<br></div><div>Elvis<br></div></div>
</blockquote></div><br></div></div>