source: geovis/branches/rex/Trace.h @ 6666

Last change on this file since 6666 was 5915, checked in by ldelgass, 9 years ago

Add zoom camera to extent (fit to vertical FOV) by layer or by explicit bounds.
Add support for image layer using ArcGIS server driver. Map projection must
use a projected profile, and "geodetic"/"wgs84"/"plate-carre" are not permitted
as map profiles: use epsg:32663 for equirectangular instead. This has linear
units in meters, not angular units in X/Y.

File size: 1.7 KB
Line 
1/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2/*
3 * Copyright (C) 2004-2013  HUBzero Foundation, LLC
4 *
5 * Author: George A. Howlett <gah@purdue.edu>
6 */
7
8#ifndef GEOVIS_TRACE_H
9#define GEOVIS_TRACE_H
10
11#include <cstring>
12#include <string>
13
14#include <syslog.h>
15
16#include <osg/NodeVisitor>
17
18namespace GeoVis {
19
20extern void logUserMessage(const char* format, ...);
21
22extern std::string getUserMessages();
23
24extern void clearUserMessages();
25
26extern void initLog();
27
28extern void closeLog();
29
30extern void logMessage(int priority, const char *funcname, const char *fileName,
31                       int lineNum, const char* format, ...);
32
33#define ERROR(...)      GeoVis::logMessage(LOG_ERR, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__)
34#ifdef WANT_TRACE
35#define TRACE(...)      GeoVis::logMessage(LOG_DEBUG, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__)
36#else
37#define TRACE(...)
38#endif  /*WANT_TRACE*/
39#ifdef WANT_FRAME
40#define FRAME(...)      GeoVis::logMessage(LOG_DEBUG, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__)
41#else
42#define FRAME(...)
43#endif  /*WANT_FRAME*/
44#define WARN(...)       GeoVis::logMessage(LOG_WARNING, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__)
45#define INFO(...)       GeoVis::logMessage(LOG_INFO, __FUNCTION__, __FILE__, __LINE__, __VA_ARGS__)
46
47#define USER_ERROR(...) GeoVis::logUserMessage(__VA_ARGS__)
48
49class GraphPrintVisitor : public osg::NodeVisitor
50{
51public:
52    GraphPrintVisitor()
53        : osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN)
54    {}
55
56    virtual void apply(osg::Node& node)
57    {
58        char space[256];
59        size_t len = getNodePath().size();
60        memset(space, ' ', len);
61        space[len] = '\0';
62        TRACE("%s%s (%s) %p", space, node.className(), node.getName().c_str(), &node);
63        traverse(node);
64    }
65};
66
67}
68
69#endif
Note: See TracBrowser for help on using the repository browser.