39 :
HttpServer::RequestHandler(
"/ion/nodegraph") {
40 IonRemoteNodeGraphRoot::RegisterAssetsOnce();
47 nodes_.push_back(node);
52 std::vector<gfx::NodePtr>::iterator it =
53 std::find(nodes_.begin(), nodes_.end(), node);
54 if (it != nodes_.end()) {
63 return std::find(nodes_.begin(), nodes_.end(), node) != nodes_.end();
68 std::string* content_type) {
69 const std::string path = path_in.empty() ?
"index.html" : path_in;
71 if (path ==
"update") {
73 SetUpPrinter(args, &printer);
74 return GetPrintString(&printer);
76 const std::string& data =
81 *content_type =
"text/html";
93 HttpServer::QueryMap::const_iterator it = args.find(
"format");
94 if (it != args.end()) {
95 const std::string& format_string = it->second;
96 if (format_string ==
"HTML")
100 it = args.find(
"enable_address_printing");
101 if (it != args.end())
104 it = args.find(
"enable_full_shape_printing");
105 if (it != args.end())
109 const std::string NodeGraphHandler::GetPrintString(gfxutils::Printer* printer) {
110 std::ostringstream s;
112 s <<
"<span class=\"nodes_header\">Tracked Nodes";
114 s <<
" at frame " << frame_->GetCounter();
115 s <<
"</span><br><br>\n";
120 s <<
"<div class=\"tree\">\n";
122 for (
size_t i = 0; i < nodes_.size(); ++i)
123 printer->PrintScene(nodes_[i], s);
bool IsInvalidReference(const T &value)
IsInvalidReference() returns true if a passed const reference of type T has an address of InvalidRefe...
void EnableFullShapePrinting(bool enable)
Sets/returns a flag indicating whether shape contents should be written.
bool RemoveNode(const gfx::NodePtr &node)
Removes a Node from being tracked.
static const std::string & GetFileData(const std::string &filename)
Returns the data of the passed filename if the manager contains it.
T * Get() const
Returns a raw pointer to the instance, which may be NULL.
void SetFormat(Format format)
Sets/returns the printed format. The default is kText.
ION_REGISTER_ASSETS(IonRemoteNodeGraphRoot)
Copyright 2016 Google Inc.
bool IsNodeTracked(const gfx::NodePtr &node) const
Returns true if the given Node is being tracked.
const std::string HandleRequest(const std::string &path, const HttpServer::QueryMap &args, std::string *content_type) override
The HandleRequest() function is passed the path (relative to its base path) of the file or directory ...
void EnableAddressPrinting(bool enable)
Sets/returns a flag indicating whether the addresses of objects should be written.
bool EndsWith(const std::string &target, const std::string &end)
Returns whether target ends with end.
~NodeGraphHandler() override
std::map< std::string, std::string > QueryMap
void AddNode(const gfx::NodePtr &node)
Adds a Node to track if it is not NULL or already tracked.
A SharedPtr is a smart shared pointer to an instance of some class that implements reference counting...
The Printer class can be used for debugging.