<div dir="ltr">You may want to look at generic programming to solve your problem.<div><a href="http://www.cs.rpi.edu/~musser/gp/GPtutorial/GPtutorial-print.pdf">http://www.cs.rpi.edu/~musser/gp/GPtutorial/GPtutorial-print.pdf</a><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 2, 2018 at 4:31 PM, Todd via vtk-developers <span dir="ltr"><<a href="mailto:vtk-developers@public.kitware.com" target="_blank">vtk-developers@public.kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><span class=""><div><br><div class="gmail_extra"><br><div class="gmail_quote">On 3 Jul 2018 9:07 a.m., Paul Douglas Hahn <<a href="mailto:pdhahn@compintensehpc.com" target="_blank">pdhahn@compintensehpc.com</a>> wrote:<br type="attribution"><blockquote class="m_5047362915493203470quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>
    revise "base classes" -> "interface classes"<br>
    <br>
    <div>On 07/02/2018 04:04 PM, Paul Douglas
      Hahn wrote:<br>
    </div>
    <blockquote>
      
      Just one caveat (you probably already know and agree with this).
      In my experience using C++ multiple inheritance, I think you
      should try to avoid situations where you have common base classes
      in the inheritance pathways. Virtual base classes are the usual
      recommendation to resolve certain problems that arise in such
      cases, but IMHO having experience with that, I generally recommend
      against it.<br>
      <br>
      So I recommend your base classes should be of the "<u>mix-in</u>"
      interface category, not relaying on any common base class. The
      approach works fine for me in almost every situation.<br>
      </blockquote></div></blockquote></div></div></div><div dir="auto"><br></div></span><div dir="auto">Thanks Paul. That sounds exactly like what I have done with the vtkCellWithEdges and vtkCellWithFaces classes introduced in the aforementioned merge request.</div><span class=""><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="m_5047362915493203470quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><blockquote><br>
      - Paul<br>
      <br>
      <div>On 07/02/2018 12:44 AM, Todd Martin
        via vtk-developers wrote:<br>
      </div>
      <blockquote>
        <div style="font-family:'helvetica neue','helvetica','arial',sans-serif;font-size:16px">
          <div style="font-family:'helvetica neue','helvetica','arial',sans-serif;font-size:16px">
            <div>
              <div>Single inheritance languages like Java and C# utilize
                <i>interfaces</i> extensively. Python 2.7+ handles the
                same concept with abstract base classes, ABCs.<br>
                <div><br>
                  <div>
                    <div>
                      <div>Is there any interest in supporting<i>
                          interfaces</i> in VTK via multiple inheritance
                        from abstract classes (which do not inherit from
                        vtkObject) while retaining the single
                        inheritance model?<br>
                        <div><br>
                          In my view there are good reasons to do so.
                          For example vtkCell has methods like
                          GetNumberOfEdges(), GetEdge(),
                          GetNumberOfFaces(), GetFace() etc. which
                          really only apply to multi-dimensional cells
                          (both linear and non-linear); i.e. not points
                          and lines. These methods are forced on the
                          base class design by a single inheritance
                          structure and the linear/non-linear cell
                          sub-types. In my view it would be better if
                          they were distributed across the sub-classes
                          via the concept of interfaces. So I'm
                          suggesting a limited use of multiple
                          inheritance here, not a free-for-all approach.
                          What do others think about this?<br>
                          <div>
                            <div>
                              <div>
                                <div><br>
                                </div>
                                For an example please see this merge
                                request <a href="https://gitlab.kitware.com/vtk/vtk/merge_requests/4372" target="_blank">Add missing
                                  size hints and bug fix point arrays
                                  for non-linear cells (!4372) · Merge
                                  Requests · VTK / VTK</a></div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                    <div><br>
                    </div>
                    <div style="max-width:400px;font-family:'neue' 'segoe ui arial',sans-serif"><a href="https://gitlab.kitware.com/vtk/vtk/merge_requests/4372" style="text-decoration:none!important;color:#000!important" target="_blank">
                        <table style="max-width:400px" border="0" cellspacing="0" cellpadding="0"><tbody><tr><td width="400">
                                <table style="max-width:400px;border-width:1px;border-style:solid;border-color:rgb(224,228,233);border-radius:2px" width="100%" border="0" cellspacing="0" cellpadding="0"><tbody><tr><td style="background-color:rgb(0,0,0);background-repeat:no-repeat;border-radius:2px 2px 0px 0px;min-height:175px" height="175" valign="top" bgcolor="#000000">
                                        <table style="width:100%" border="0" cellspacing="0" cellpadding="0"><tbody><tr><td style="background-color:transparent;border-radius:2px 2px 0px 0px;min-height:175px" valign="top" bgcolor="transparent">
                                                <table style="width:100%;min-height:175px" border="0"><tbody><tr><td style="text-align:left;padding:15px 0 0 15px;vertical-align:top"><br>
                                                      </td><td style="text-align:right;padding:15px 15px 0 0;vertical-align:top"><br>
                                                      </td></tr></tbody></table>
                                                </td></tr></tbody></table>
                                      </td></tr><tr><td>
                                        <table style="background-color:rgb(255,255,255);background-image:none;background-repeat:repeat;width:100%;max-width:400px;border-radius:0px 0px 2px 2px;border-top:1px solid rgb(224,228,233)" border="0" cellspacing="0" cellpadding="0" align="center"><tbody><tr><td style="background-color:#ffffff;padding:16px 0 16px 12px;vertical-align:top;border-radius:0 0 0 2px"><br>
                                              </td><td style="vertical-align:middle;padding:12px 24px 16px 12px;width:99%;font-family:'neue' 'segoe ui arial',sans-serif;border-radius:0 0 2px 0">
                                                <h2 style="font-size:14px;line-height:19px;margin:0 0 6px 0;font-family:'neue' 'segoe ui','helvetica','arial',sans-serif;color:#26282a">Add
                                                  missing size hints and
                                                  bug fix point arrays
                                                  for non-linear cells
                                                  (!4...</h2>
                                                <p style="font-size:12px;line-height:16px;margin:0px;color:#979ba7">I've
                                                  added size hints for
                                                  concrete public
                                                  methods
                                                  GetParametricCoords(),
                                                  GetEdgePoints() and
                                                  GetFacePoints() in ...</p>
                                              </td></tr></tbody></table>
                                      </td></tr></tbody></table>
                              </td></tr></tbody></table>
                      </a></div>
                    <div><br>
                    </div>
                    <div><br>
                    </div>
                  </div>
                </div>
              </div>
              <div><br>
              </div>
              <div>
                <div style="font-size:16px;font-family:'helvetica','arial',sans-serif">
                  <div>Todd Martin, PhD.<br>
                  </div>
                  <div><i>Freelance Engineer/Software Architect.</i></div>
                  <br>
                </div>
              </div>
            </div>
          </div>
        </div>
        <br>
        <fieldset></fieldset>
        <br>
        <pre>______________________________<wbr>_________________
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a>

Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a>

Search the list archives at: <a href="http://markmail.org/search/?q=vtk-developers" target="_blank">http://markmail.org/search/?q=<wbr>vtk-developers</a>

Follow this link to subscribe/unsubscribe:
<a href="https://public.kitware.com/mailman/listinfo/vtk-developers" target="_blank">https://public.kitware.com/<wbr>mailman/listinfo/vtk-<wbr>developers</a>

</pre>
      </blockquote>
      <br>
      <br>
      <pre>-- 
Paul D. Hahn
CompIntense HPC, LLC
</pre>
    </blockquote>
    <br>
    <br>
    <pre>-- 
Paul D. Hahn
CompIntense HPC, LLC
</pre>
  </div>
</blockquote></div><br></div></div></span></div><br>______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtk-developers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtk-developers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://public.kitware.com/mailman/listinfo/vtk-developers" rel="noreferrer" target="_blank">https://public.kitware.com/<wbr>mailman/listinfo/vtk-<wbr>developers</a><br>
<br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Unpaid intern in BillsParadise at noware dot com</div>
</div>