Re: shouldn't need graf3d

From: Valeri Fine (Faine) (fine@bnl.gov)
Date: Fri Mar 03 2000 - 16:58:20 MET


Dear, Ivana 

Thank you very much for your kind clarification.

>  Just one comment for not confusing C++ beginners
>  by using incorrect terminology:

  I think the beginners first will be confused with a syntax error if they try
  to apply what you said:

> > inline void TPadView3D::ExecuteEvent(Int_t, Int_t, Int_t) = 0;

You wrote:

> >   This is not an abstract interface as it does not contain any
> >   abstract method. The abstract methods look like this:

  What you said is defined by C++ as 
                      "abstract base class".

  But myself was speaking about
              ". . . abstract interface between TPad . . . "

  It is a typical "terminology confusion" when begginer reads a C++ 
  textbook.
  Alas C++ is filled with the terminology "underwater stones"
  (just count how many diffrent meaning the statment "static" has )

  If the class provides only prototypes with no real implementation, 
  that is no use/ instantiated directly and does require another class 
  to be derived  from that such class does define an abstract interface.
  Well some time it is more safe to implement the "abstract interface" 
  with  "abstract base class" but unfortunately it is not always possible.
 (for example one needs to meet a constrain: this class should cause 
  no "loader" problem  for any compiler / platforms combination. )

  Hope this helps,

             With  my best regards, 
                                       Valery
 
> 
> On Thu, 2 Mar 2000, Valeri Fine (Faine) wrote:
> 
> > TPadView3D is an abstract interface between TPad and some concrete
> > 3D viewer. So it must  be linked with very TPad but should impose no extra 
> > dependencies since all its methods look as follows:
> > 
> > inline void TPadView3D::ExecuteEvent(Int_t, Int_t, Int_t) { }
> > inline void TPadView3D::Paint(Option_t *) { }
> > inline void TPadView3D::Size(Int_t, Int_t) { }
> > inline void TPadView3D::PaintBeginModel(Option_t *) { }
> > inline void TPadView3D::PaintEnd(Option_t *) { }
> > inline void TPadView3D::PaintScene(Option_t *) { }
> > inline void TPadView3D::PaintPolyMarker(TPolyMarker3D *, Option_t *) { }
> > inline void TPadView3D::PaintPolyLine(TPolyLine3D *, Option_t *) { }
> > inline void TPadView3D::PaintPoints3D(const TPoints3DABC *,Option_t *){ }
> > inline void TPadView3D::SetAttNode(TNode *, Option_t *) { }
> > inline void TPadView3D::SetLineAttr(Color_t ,Int_t ,Option_t *) { }
> > inline void TPadView3D::UpdateNodeMatrix(TNode *, Option_t *) { }
> > inline void TPadView3D::UpdatePosition(Double_t ,Double_t ,Double_t ,TRotMatrix *, Option_t *){ }
> 
>   This is not an abstract interface as it does not contain any
>   abstract method. The abstract methods look like this:
> 
> > inline void TPadView3D::ExecuteEvent(Int_t, Int_t, Int_t) = 0;
> > inline void TPadView3D::Paint(Option_t *) = 0;
>   ... etc.
> 
>   Making a method abstract enforces all derived classes to
>   provide implementation of this method. If you omit this
>   implementation than you will not be able to instantiate
>   such derived class. 
>   (Compiler will give you error on "new MyDerivedClass" if
>    implementation of any abstract method is missing.) 
> 
>   This is used in interfaces for ensuring that all interface
>   implementation will provide the required methods.
> 
>   Best regards,
> 
>   Ivana Hrivnacova  
> 
> ==============================================================
> e-mail:  Ivana.Hrivnacova@cern.ch
> address: PPE Division; 160-1-016; CERN; 1211 Geneve; Switzerland
> phone:   (022)-767-9749
> Home institute: NPI Rez near Prague, Czech Republic
> ==============================================================
> 
> 
> 



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:20 MET