Skip to content

Commit

Permalink
ObjectIDPicker: add set/getRTTSize methods #2023
Browse files Browse the repository at this point in the history
  • Loading branch information
gwaldron committed Oct 23, 2023
1 parent c3e4665 commit ad1117d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/osgEarth/ObjectIDPicker
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ namespace osgEarth { namespace Util
void setBuffer(int value) { _buffer = value; }
int getBuffer() const { return _buffer; }

//! Size of the RTT image (pixels per side) - must call before setView()
void setRTTSize(int value) { _rttSize = value; }
int getRTTSize() const { return _rttSize; }

using Function = std::function<void(ObjectID)>;

//! Function to call when the user hovers an object
Expand Down
2 changes: 2 additions & 0 deletions src/osgEarth/ObjectIDPicker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ ObjectIDPicker::~ObjectIDPicker()
void
ObjectIDPicker::setView(osgViewer::View* view)
{
OE_SOFT_ASSERT_AND_RETURN(_rttSize >= 1, void());

if (view != _view.get())
{
_view = view;
Expand Down

0 comments on commit ad1117d

Please sign in to comment.