Logo ROOT  
Reference Guide
RDrawable.cxx
Go to the documentation of this file.
1/*************************************************************************
2 * Copyright (C) 1995-2015, Rene Brun and Fons Rademakers. *
3 * All rights reserved. *
4 * *
5 * For the licensing terms see $ROOTSYS/LICENSE. *
6 * For the list of contributors see $ROOTSYS/README/CREDITS. *
7 *************************************************************************/
8
9#include "ROOT/RDrawable.hxx"
10#include "ROOT/RDisplayItem.hxx"
11
12
13#include <cassert>
14#include <string>
15
16
17// pin vtable
19
21{
22 assert(false && "Did not expect a menu item to be invoked!");
23}
24
25/////////////////////////////////////////////////////////////////////////////
26/// Preliminary method which checks if drawable matches with given selector
27/// Following selector are allowed:
28/// "type" or "#id" or ".class_name"
29/// Here type is drawable kind like 'rect' or 'pad'
30/// id is drawable identifier, specified with RDrawable::SetId() method
31/// class_name is drawable class name, specified with RDrawable::SetCssClass() method
32
33bool ROOT::Experimental::RDrawable::MatchSelector(const std::string &selector) const
34{
35 return (selector == fCssType) || (!fCssClass.empty() && (selector == std::string(".") + fCssClass)) || (!fId.empty() && (selector == std::string("#") + fId));
36}
37
38/////////////////////////////////////////////////////////////////////////////
39/// Creates display item for drawable
40/// By default item contains drawble data itself
41
42std::unique_ptr<ROOT::Experimental::RDisplayItem> ROOT::Experimental::RDrawable::Display() const
43{
44 return std::make_unique<RDrawableDisplayItem>(*this);
45}
virtual void Execute(const std::string &)
Definition: RDrawable.cxx:20
virtual std::unique_ptr< RDisplayItem > Display() const
Creates display item for drawable By default item contains drawble data itself.
Definition: RDrawable.cxx:42
bool MatchSelector(const std::string &selector) const
Preliminary method which checks if drawable matches with given selector Following selector are allowe...
Definition: RDrawable.cxx:33