Check whether a shape intersects any other in the world

Hey, I have a world setup with some objects and I want to check whether one given shape intersects anything in this world. Note that the simulation is not running during the process. Just that 🙂

THanks.
GUys, I am sure this is possible. I'll rephrase that to make it clear.

Basically, I have a world with a few static objects and what I want to do is to allow the user to place objects (namely discs) in the screen before the simulation starts. But the user can only place a disc at locations where it won't intersect anything already present in the world. Then when placing the disc (in a mouse click event handler) I must first check whether the disc intersects anything; if it does an error message is shown, otherwise the disc is added to the world. Understood? Help 😮)

Thanks.
Cant you just use collision responses somehow? Perhaps have the bodies already on the world as sensors, and trap collisions with them...if there is a collision, you cant place it?
You should use the AABB query function on the b2World class. Then use b2TestOverlap for each fixture.
I use the following function IsOverlap() to do exactly what Erin suggests. I simplified it a bit from my actual code, so there might be some minor syntax errors. If someone can simplify it even more, then please don't hold back.

EDIT: I just read that you only want to check a shape against the rest of the world, so my function is a bit overkill for you. But you can propably figure out how to do so yourself based on the example.

Code:
/// Returns true if the given body overlaps any other body in the world.
bool IsOverlap( const b2World* world, const b2Body* body )
{
   CheckOverlapCallback callback( body );
   world->QueryAABB( &callback, GetBodyAABB( body ) );
   return callback.m_isOverlap;
}

/// Gets the combined AABB of all shapes of the given body.
b2AABB GetBodyAABB( const b2Body* body )
{
   b2AABB result;
   b2Transform trans = body->GetTransform();
   const b2Fixture* first = body->GetFixtureList();

   for( const b2Fixture* fixture = first; fixture; fixture = fixture->GetNext() )
   {
      b2AABB aabb;
      fixture->GetShape()->ComputeAABB( &aabb, trans, 0 );
      if( fixture == first )
         result = aabb;
      else
         result.Combine( aabb );      
   }   
   
   return result;
}

/// Callback to check for overlap of given body.
struct CheckOverlapCallback : b2QueryCallback
{
   CheckOverlapCallback( const b2Body* body ) :
      m_body( body ), m_isOverlap( false ) {}

   // override
   bool ReportFixture( b2Fixture* fixture )
   {
      // Skip self.
      if( fixture->GetBody() == m_body )
         return true;
      
      for( const b2Fixture* bodyFixture = m_body->GetFixtureList(); bodyFixture;
          bodyFixture = bodyFixture->GetNext() )
      {
         if( b2TestOverlap( fixture->GetShape(), 0, bodyFixture->GetShape(), 0,
            fixture->GetBody()->GetTransform(), m_body->GetTransform() ) )
         {
            m_isOverlap = true;
            return false;            
         }
      }
   }
   
   const b2Body* m_body;
   bool m_isOverlap;
};

Original thread: https://box2d.org/forum/viewtopic.php?t=5582